mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-10 22:37:28 +01:00
54 lines
1.3 KiB
PHP
54 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Integration\Entity\Source;
|
|
|
|
use Doctrine\ORM\EntityManagerInterface;
|
|
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
|
use Infinito\Repository\Source\SourceRepository;
|
|
use Infinito\Entity\Source\PureSourceInterface;
|
|
use Infinito\Entity\Source\PureSource;
|
|
|
|
/**
|
|
* @author kevinfrantz
|
|
*/
|
|
class PureSourceIntegrationTest extends KernelTestCase
|
|
{
|
|
/**
|
|
* @var EntityManagerInterface
|
|
*/
|
|
private $entityManager;
|
|
|
|
/**
|
|
* @var SourceRepository
|
|
*/
|
|
private $sourceRepository;
|
|
|
|
/**
|
|
* @var PureSourceInterface
|
|
*/
|
|
private $pureSource;
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*
|
|
* @see \PHPUnit\Framework\TestCase::setUp()
|
|
*/
|
|
public function setUp(): void
|
|
{
|
|
self::bootKernel();
|
|
$this->entityManager = self::$container->get('doctrine.orm.default_entity_manager');
|
|
$this->sourceRepository = $this->entityManager->getRepository(PureSource::class);
|
|
$this->pureSource = new PureSource();
|
|
}
|
|
|
|
public function testDatabaseProcess(): void
|
|
{
|
|
$this->entityManager->persist($this->pureSource);
|
|
$this->entityManager->flush();
|
|
$this->assertGreaterThan(0, $this->pureSource->getId());
|
|
$this->entityManager->remove($this->pureSource);
|
|
$this->entityManager->flush();
|
|
$this->assertNull($this->pureSource->getId());
|
|
}
|
|
}
|