futurePersonSignatures[] = new Person(); $entityWorkflow->setStep('step_signature', $stepTransition, 'to_signature', new \DateTimeImmutable('now'), new User()); $signature = $entityWorkflow->getCurrentStep()->getSignatures()->first(); $entityWorkflowManager = $this->createMock(EntityWorkflowManager::class); $entityWorkflowManager->method('getAssociatedStoredObject') ->with($entityWorkflow) ->willReturn($storedObject); $pdfSignatureZoneAvailable = $this->createMock(PDFSignatureZoneAvailable::class); $pdfSignatureZoneAvailable->method('getAvailableSignatureZones')->withAnyParameters() ->willReturn([ new PDFSignatureZone(1, 0.0, 0.0, 100, 100, new PDFPage(1, 500.0, 500.0)), ]); $normalizer = $this->createMock(NormalizerInterface::class); $normalizer->method('normalize')->withAnyParameters() ->willReturn([]); $twig = $this->createMock(Environment::class); $twig->method('render')->with('@ChillMain/Workflow/_signature_sign.html.twig', $this->isType('array')) ->willReturn('ok'); $controller = new WorkflowAddSignatureController($entityWorkflowManager, $pdfSignatureZoneAvailable, $normalizer, $twig); $actual = $controller($signature, new Request()); self::assertEquals(200, $actual->getStatusCode()); self::assertEquals('ok', $actual->getContent()); } }