diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/WorkflowOnHoldControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/WorkflowOnHoldControllerTest.php index 5ca829029..8c06e9f90 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/WorkflowOnHoldControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/WorkflowOnHoldControllerTest.php @@ -6,6 +6,7 @@ use Chill\MainBundle\Controller\WorkflowOnHoldController; use Chill\MainBundle\Entity\Workflow\EntityWorkflow; use Chill\MainBundle\Entity\Workflow\EntityWorkflowStep; use Chill\MainBundle\Entity\Workflow\EntityWorkflowStepHold; +use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository; use Chill\MainBundle\Repository\Workflow\EntityWorkflowStepHoldRepository; use Chill\MainBundle\Security\ChillSecurity; use Doctrine\ORM\EntityManagerInterface; @@ -41,6 +42,7 @@ class WorkflowOnHoldControllerTest extends KernelTestCase $this->security = $this->createMock(Security::class); $this->registry = $this->createMock(Registry::class); $this->entityWorkflowStepHoldRepository = $this->createMock(EntityWorkflowStepHoldRepository::class); + $this->entityWorkflowRepository = $this->createMock(EntityWorkflowRepository::class); $this->entityWorkflow = $this->createMock(EntityWorkflow::class); $this->workflow = $this->createMock(Workflow::class); @@ -59,7 +61,8 @@ class WorkflowOnHoldControllerTest extends KernelTestCase $this->entityManager, $this->security, $this->registry, - $this->entityWorkflowStepHoldRepository + $this->entityWorkflowStepHoldRepository, + $this->entityWorkflowRepository ); } @@ -85,20 +88,13 @@ class WorkflowOnHoldControllerTest extends KernelTestCase ->method('flush'); $request = new Request(); - $controller->putOnHold($this->entityWorkflow, $request); + $this->controller->putOnHold($this->entityWorkflow, $request); } public function testPutOnHoldSmokeTest(): void { - $controller = new WorkflowOnHoldController( - $this->entityManager, - $this->security, - $this->registry, - $this->entityWorkflowStepHoldRepository - ); - $request = new Request(); - $response = $controller->putOnHold($this->entityWorkflow, $request); + $response = $this->controller->putOnHold($this->entityWorkflow, $request); $this->assertInstanceOf(Response::class, $response); $this->assertEquals(302, $response->getStatusCode());