Optimized fixtures

This commit is contained in:
Kevin Frantz
2018-11-23 22:09:29 +01:00
parent 4066634af2
commit e16f2a44a8
4 changed files with 94 additions and 3 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace Tests\Integration;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Doctrine\ORM\EntityManager;
use App\Entity\Source\AbstractSource;
use App\DBAL\Types\SystemSlugType;
use App\Entity\Source\Primitive\Text\TextSourceInterface;
class FixturesIntegrationTest extends KernelTestCase
{
/**
* @var EntityManager
*/
protected $entityManager;
public function setUp(): void
{
self::bootKernel();
$this->entityManager = static::$kernel->getContainer()->get('doctrine')->getManager();
}
public function testImpressum(): void
{
$sourceRepository = $this->entityManager->getRepository(AbstractSource::class);
/**
* @var TextSourceInterface
*/
$imprint = $sourceRepository->findOneBy(['slug' => SystemSlugType::IMPRINT]);
$this->assertInternalType('string', $imprint->getText());
}
}