improv
This commit is contained in:
parent
66c4c1fe4f
commit
2c2e34b71e
42 changed files with 910 additions and 939 deletions
|
@ -1,10 +1,13 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests;
|
||||
|
||||
use Exception;
|
||||
use Override;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Tools\SchemaTool;
|
||||
use Tests\TestCase;
|
||||
|
||||
abstract class DbTestCase extends TestCase
|
||||
{
|
||||
|
@ -13,7 +16,7 @@ abstract class DbTestCase extends TestCase
|
|||
$em = $this->getContainer()->get(EntityManagerInterface::class);
|
||||
$metadata = $em->getMetadataFactory()->getAllMetadata();
|
||||
if (empty($metadata)) {
|
||||
throw new \Exception('No metadata found. Did you forget to map entities?');
|
||||
throw new Exception('No metadata found. Did you forget to map entities?');
|
||||
}
|
||||
$schemaTool = new SchemaTool($em);
|
||||
$schemaTool->dropDatabase(); // Clean slate, in case anything exists
|
||||
|
@ -21,12 +24,13 @@ abstract class DbTestCase extends TestCase
|
|||
parent::setUp();
|
||||
}
|
||||
|
||||
#[Override]
|
||||
protected function tearDown(): void
|
||||
{
|
||||
$em = $this->getContainer()->get(EntityManagerInterface::class);
|
||||
$metadata = $em->getMetadataFactory()->getAllMetadata();
|
||||
if (empty($metadata)) {
|
||||
throw new \Exception('No metadata found. Did you forget to map entities?');
|
||||
throw new Exception('No metadata found. Did you forget to map entities?');
|
||||
}
|
||||
$schemaTool = new SchemaTool($em);
|
||||
$schemaTool->dropDatabase(); // Clean slate, in case anything exists
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue