mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-10-31 17:29:04 +00:00 
			
		
		
		
	Optimized LayerRepositoryFactoryService
This commit is contained in:
		| @@ -0,0 +1,34 @@ | ||||
| <?php | ||||
|  | ||||
| namespace tests\Unit\Domain\RepositoryManagement; | ||||
|  | ||||
| use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||||
| use App\Domain\RepositoryManagement\LayerRepositoryFactoryServiceInterface; | ||||
| use App\Domain\RepositoryManagement\LayerRepositoryFactoryService; | ||||
| use App\Repository\RepositoryInterface; | ||||
|  | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
|  */ | ||||
| class LayerRepositoryFactoryServiceTest extends KernelTestCase | ||||
| { | ||||
|     /** | ||||
|      * @var LayerRepositoryFactoryServiceInterface | ||||
|      */ | ||||
|     private $layerRepositoryFactoryService; | ||||
|  | ||||
|     public function setUp(): void | ||||
|     { | ||||
|         self::bootKernel(); | ||||
|         $entityManager = self::$container->get('doctrine')->getManager(); | ||||
|         $this->layerRepositoryFactoryService = new LayerRepositoryFactoryService($entityManager); | ||||
|     } | ||||
|  | ||||
|     public function testGetRepository(): void | ||||
|     { | ||||
|         foreach (LayerRepositoryFactoryService::LAYER_CLASS_MAP as $layer => $class) { | ||||
|             $repositoy = $this->layerRepositoryFactoryService->getRepository($layer); | ||||
|             $this->assertInstanceOf(RepositoryInterface::class, $repositoy); | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user