requestedRight = new Right(); } private function setEntityManager(): void { $this->entityManager = self::$container->get('doctrine.orm.default_entity_manager'); } private function setViewHandler(): void { $this->viewHandler = $this->createMock(ViewHandlerInterface::class); } public function setUp(): void { self::bootKernel(); $this->setEntityManager(); $this->setRequestedRight(); $this->setViewHandler(); } public function testAllreadyDefinedException(): void { $requestedSource = new PureSource(); $requestedSource->setSlug(SystemSlugType::IMPRINT); $requestedRight = new Right(); $requestedRight->setSource($requestedSource); $requestedRight->setReciever(new PureSource()); $requestedRight->setLayer(LayerType::SOURCE); $requestedRight->setType(CRUDType::READ); $this->expectException(AllreadyDefinedException::class); $sourceResponseManager = new SourceRESTResponseManager(null, $this->entityManager, $requestedRight, $this->viewHandler); $sourceResponseManager->getResponse(); } }