Optimized test coverage for LayerRepositoryFactoryService on 100%

This commit is contained in:
Kevin Frantz 2019-01-20 13:07:45 +01:00
parent 36340dcff3
commit f6978628b9

View File

@ -6,6 +6,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use App\Domain\RepositoryManagement\LayerRepositoryFactoryServiceInterface;
use App\Domain\RepositoryManagement\LayerRepositoryFactoryService;
use App\Repository\RepositoryInterface;
use App\Exception\NotSetException;
/**
* @author kevinfrantz
@ -26,9 +27,11 @@ class LayerRepositoryFactoryServiceTest extends KernelTestCase
public function testGetRepository(): void
{
foreach (LayerRepositoryFactoryService::LAYER_CLASS_MAP as $layer => $class) {
foreach (array_keys(LayerRepositoryFactoryService::LAYER_CLASS_MAP) as $layer) {
$repositoy = $this->layerRepositoryFactoryService->getRepository($layer);
$this->assertInstanceOf(RepositoryInterface::class, $repositoy);
}
$this->expectException(NotSetException::class);
$repositoy = $this->layerRepositoryFactoryService->getRepository('UnknownLayer');
}
}