infinito/application/symfony/tests/Integration/Entity/Source/PureSourceIntegrationTest.php

54 lines
1.3 KiB
PHP
Raw Permalink Normal View History

2019-01-04 21:28:21 +01:00
<?php
namespace Integration\Entity\Source;
use Doctrine\ORM\EntityManagerInterface;
use Infinito\Entity\Source\PureSource;
2020-04-02 21:13:35 +02:00
use Infinito\Entity\Source\PureSourceInterface;
use Infinito\Repository\Source\SourceRepository;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
2019-01-04 21:28:21 +01:00
/**
* @author kevinfrantz
*/
class PureSourceIntegrationTest extends KernelTestCase
{
/**
* @var EntityManagerInterface
*/
private $entityManager;
/**
* @var SourceRepository
*/
private $sourceRepository;
/**
* @var PureSourceInterface
*/
private $pureSource;
2019-02-12 18:04:36 +01:00
/**
* {@inheritdoc}
*
* @see \PHPUnit\Framework\TestCase::setUp()
*/
2019-01-04 21:28:21 +01:00
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());
2019-01-04 21:28:21 +01:00
}
}