mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 17:23:12 +08:00
Simplified database tests by updating to shlinkio/shlink-test-utils 2
This commit is contained in:
@@ -15,11 +15,9 @@ use Shlinkio\Shlink\TestUtils\DbTest\DatabaseTestCase;
|
||||
|
||||
class DomainRepositoryTest extends DatabaseTestCase
|
||||
{
|
||||
protected const ENTITIES_TO_EMPTY = [ShortUrl::class, Domain::class, ApiKey::class];
|
||||
|
||||
private DomainRepository $repo;
|
||||
|
||||
protected function setUp(): void
|
||||
protected function beforeEach(): void
|
||||
{
|
||||
$this->repo = $this->getEntityManager()->getRepository(Domain::class);
|
||||
}
|
||||
|
||||
@@ -29,17 +29,9 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
|
||||
{
|
||||
use TagManagerTrait;
|
||||
|
||||
protected const ENTITIES_TO_EMPTY = [
|
||||
Tag::class,
|
||||
Visit::class,
|
||||
ShortUrl::class,
|
||||
Domain::class,
|
||||
ApiKey::class,
|
||||
];
|
||||
|
||||
private ShortUrlRepository $repo;
|
||||
|
||||
public function setUp(): void
|
||||
public function beforeEach(): void
|
||||
{
|
||||
$this->repo = $this->getEntityManager()->getRepository(ShortUrl::class);
|
||||
}
|
||||
|
||||
@@ -21,17 +21,9 @@ use function array_chunk;
|
||||
|
||||
class TagRepositoryTest extends DatabaseTestCase
|
||||
{
|
||||
protected const ENTITIES_TO_EMPTY = [
|
||||
Visit::class,
|
||||
ShortUrl::class,
|
||||
Tag::class,
|
||||
ApiKey::class,
|
||||
Domain::class,
|
||||
];
|
||||
|
||||
private TagRepository $repo;
|
||||
|
||||
protected function setUp(): void
|
||||
protected function beforeEach(): void
|
||||
{
|
||||
$this->repo = $this->getEntityManager()->getRepository(Tag::class);
|
||||
}
|
||||
|
||||
@@ -27,18 +27,9 @@ use function sprintf;
|
||||
|
||||
class VisitRepositoryTest extends DatabaseTestCase
|
||||
{
|
||||
protected const ENTITIES_TO_EMPTY = [
|
||||
VisitLocation::class,
|
||||
Visit::class,
|
||||
ShortUrl::class,
|
||||
Domain::class,
|
||||
Tag::class,
|
||||
ApiKey::class,
|
||||
];
|
||||
|
||||
private VisitRepository $repo;
|
||||
|
||||
protected function setUp(): void
|
||||
protected function beforeEach(): void
|
||||
{
|
||||
$this->repo = $this->getEntityManager()->getRepository(Visit::class);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user