mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Updated structure for tests config files
This commit is contained in:
10
module/Common/test-db/ApiTest/ApiTestCase.php
Normal file
10
module/Common/test-db/ApiTest/ApiTestCase.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ShlinkioTest\Shlink\Common\ApiTest;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
abstract class ApiTestCase extends TestCase
|
||||
{
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user