mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Correct instantiation of controller within test
This commit is contained in:
parent
745a29f742
commit
8c4f342ca1
@ -6,6 +6,7 @@ use Chill\MainBundle\Controller\WorkflowOnHoldController;
|
|||||||
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
|
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
|
||||||
use Chill\MainBundle\Entity\Workflow\EntityWorkflowStep;
|
use Chill\MainBundle\Entity\Workflow\EntityWorkflowStep;
|
||||||
use Chill\MainBundle\Entity\Workflow\EntityWorkflowStepHold;
|
use Chill\MainBundle\Entity\Workflow\EntityWorkflowStepHold;
|
||||||
|
use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository;
|
||||||
use Chill\MainBundle\Repository\Workflow\EntityWorkflowStepHoldRepository;
|
use Chill\MainBundle\Repository\Workflow\EntityWorkflowStepHoldRepository;
|
||||||
use Chill\MainBundle\Security\ChillSecurity;
|
use Chill\MainBundle\Security\ChillSecurity;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
@ -41,6 +42,7 @@ class WorkflowOnHoldControllerTest extends KernelTestCase
|
|||||||
$this->security = $this->createMock(Security::class);
|
$this->security = $this->createMock(Security::class);
|
||||||
$this->registry = $this->createMock(Registry::class);
|
$this->registry = $this->createMock(Registry::class);
|
||||||
$this->entityWorkflowStepHoldRepository = $this->createMock(EntityWorkflowStepHoldRepository::class);
|
$this->entityWorkflowStepHoldRepository = $this->createMock(EntityWorkflowStepHoldRepository::class);
|
||||||
|
$this->entityWorkflowRepository = $this->createMock(EntityWorkflowRepository::class);
|
||||||
|
|
||||||
$this->entityWorkflow = $this->createMock(EntityWorkflow::class);
|
$this->entityWorkflow = $this->createMock(EntityWorkflow::class);
|
||||||
$this->workflow = $this->createMock(Workflow::class);
|
$this->workflow = $this->createMock(Workflow::class);
|
||||||
@ -59,7 +61,8 @@ class WorkflowOnHoldControllerTest extends KernelTestCase
|
|||||||
$this->entityManager,
|
$this->entityManager,
|
||||||
$this->security,
|
$this->security,
|
||||||
$this->registry,
|
$this->registry,
|
||||||
$this->entityWorkflowStepHoldRepository
|
$this->entityWorkflowStepHoldRepository,
|
||||||
|
$this->entityWorkflowRepository
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,20 +88,13 @@ class WorkflowOnHoldControllerTest extends KernelTestCase
|
|||||||
->method('flush');
|
->method('flush');
|
||||||
|
|
||||||
$request = new Request();
|
$request = new Request();
|
||||||
$controller->putOnHold($this->entityWorkflow, $request);
|
$this->controller->putOnHold($this->entityWorkflow, $request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testPutOnHoldSmokeTest(): void
|
public function testPutOnHoldSmokeTest(): void
|
||||||
{
|
{
|
||||||
$controller = new WorkflowOnHoldController(
|
|
||||||
$this->entityManager,
|
|
||||||
$this->security,
|
|
||||||
$this->registry,
|
|
||||||
$this->entityWorkflowStepHoldRepository
|
|
||||||
);
|
|
||||||
|
|
||||||
$request = new Request();
|
$request = new Request();
|
||||||
$response = $controller->putOnHold($this->entityWorkflow, $request);
|
$response = $this->controller->putOnHold($this->entityWorkflow, $request);
|
||||||
|
|
||||||
$this->assertInstanceOf(Response::class, $response);
|
$this->assertInstanceOf(Response::class, $response);
|
||||||
$this->assertEquals(302, $response->getStatusCode());
|
$this->assertEquals(302, $response->getStatusCode());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user