createMock(RequestedActionInterface::class); $requestedAction->method('hasRequestedEntity')->willReturn(false); $formFactory = $this->createMock(FormFactoryInterface::class); $formClassNameService = $this->createMock(FormClassNameServiceInterface::class); $requestedActionFormBuilder = new RequestedActionFormBuilder($formFactory, $formClassNameService); $this->expectException(NotSetException::class); $requestedActionFormBuilder->create($requestedAction); } }