Updated structure for tests config files

This commit is contained in:
Alejandro Celaya
2019-01-26 09:09:49 +01:00
parent e7c5cf0846
commit 87ba7a7179
10 changed files with 39 additions and 14 deletions

View File

@@ -0,0 +1,10 @@
<?php
declare(strict_types=1);
namespace ShlinkioTest\Shlink\Common\ApiTest;
use PHPUnit\Framework\TestCase;
abstract class ApiTestCase extends TestCase
{
}

View File

@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
namespace ShlinkioTest\Shlink\Common\DbUnit;
namespace ShlinkioTest\Shlink\Common\DbTest;
use Doctrine\ORM\EntityManagerInterface;
use PHPUnit\Framework\TestCase;
@@ -20,14 +20,12 @@ abstract class DatabaseTestCase extends TestCase
public function tearDown()
{
// Empty all entity tables defined by this test after each test
foreach (static::ENTITIES_TO_EMPTY as $entityClass) {
$qb = $this->getEntityManager()->createQueryBuilder();
$qb->delete($entityClass, 'x');
$qb->getQuery()->execute();
}
// Clear entity manager
$this->getEntityManager()->clear();
}
}