mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-22 23:23:42 -06:00
Simplified database tests by updating to shlinkio/shlink-test-utils 2
This commit is contained in:
parent
da9e9df4ba
commit
c5fc8fbf00
@ -71,7 +71,7 @@
|
|||||||
"phpunit/phpunit": "^9.5",
|
"phpunit/phpunit": "^9.5",
|
||||||
"roave/security-advisories": "dev-master",
|
"roave/security-advisories": "dev-master",
|
||||||
"shlinkio/php-coding-standard": "~2.1.1",
|
"shlinkio/php-coding-standard": "~2.1.1",
|
||||||
"shlinkio/shlink-test-utils": "^1.7",
|
"shlinkio/shlink-test-utils": "^2.0",
|
||||||
"symfony/var-dumper": "^5.2",
|
"symfony/var-dumper": "^5.2",
|
||||||
"veewee/composer-run-parallel": "^0.1.0"
|
"veewee/composer-run-parallel": "^0.1.0"
|
||||||
},
|
},
|
||||||
|
@ -15,11 +15,9 @@ use Shlinkio\Shlink\TestUtils\DbTest\DatabaseTestCase;
|
|||||||
|
|
||||||
class DomainRepositoryTest extends DatabaseTestCase
|
class DomainRepositoryTest extends DatabaseTestCase
|
||||||
{
|
{
|
||||||
protected const ENTITIES_TO_EMPTY = [ShortUrl::class, Domain::class, ApiKey::class];
|
|
||||||
|
|
||||||
private DomainRepository $repo;
|
private DomainRepository $repo;
|
||||||
|
|
||||||
protected function setUp(): void
|
protected function beforeEach(): void
|
||||||
{
|
{
|
||||||
$this->repo = $this->getEntityManager()->getRepository(Domain::class);
|
$this->repo = $this->getEntityManager()->getRepository(Domain::class);
|
||||||
}
|
}
|
||||||
|
@ -29,17 +29,9 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
|
|||||||
{
|
{
|
||||||
use TagManagerTrait;
|
use TagManagerTrait;
|
||||||
|
|
||||||
protected const ENTITIES_TO_EMPTY = [
|
|
||||||
Tag::class,
|
|
||||||
Visit::class,
|
|
||||||
ShortUrl::class,
|
|
||||||
Domain::class,
|
|
||||||
ApiKey::class,
|
|
||||||
];
|
|
||||||
|
|
||||||
private ShortUrlRepository $repo;
|
private ShortUrlRepository $repo;
|
||||||
|
|
||||||
public function setUp(): void
|
public function beforeEach(): void
|
||||||
{
|
{
|
||||||
$this->repo = $this->getEntityManager()->getRepository(ShortUrl::class);
|
$this->repo = $this->getEntityManager()->getRepository(ShortUrl::class);
|
||||||
}
|
}
|
||||||
|
@ -21,17 +21,9 @@ use function array_chunk;
|
|||||||
|
|
||||||
class TagRepositoryTest extends DatabaseTestCase
|
class TagRepositoryTest extends DatabaseTestCase
|
||||||
{
|
{
|
||||||
protected const ENTITIES_TO_EMPTY = [
|
|
||||||
Visit::class,
|
|
||||||
ShortUrl::class,
|
|
||||||
Tag::class,
|
|
||||||
ApiKey::class,
|
|
||||||
Domain::class,
|
|
||||||
];
|
|
||||||
|
|
||||||
private TagRepository $repo;
|
private TagRepository $repo;
|
||||||
|
|
||||||
protected function setUp(): void
|
protected function beforeEach(): void
|
||||||
{
|
{
|
||||||
$this->repo = $this->getEntityManager()->getRepository(Tag::class);
|
$this->repo = $this->getEntityManager()->getRepository(Tag::class);
|
||||||
}
|
}
|
||||||
|
@ -27,18 +27,9 @@ use function sprintf;
|
|||||||
|
|
||||||
class VisitRepositoryTest extends DatabaseTestCase
|
class VisitRepositoryTest extends DatabaseTestCase
|
||||||
{
|
{
|
||||||
protected const ENTITIES_TO_EMPTY = [
|
|
||||||
VisitLocation::class,
|
|
||||||
Visit::class,
|
|
||||||
ShortUrl::class,
|
|
||||||
Domain::class,
|
|
||||||
Tag::class,
|
|
||||||
ApiKey::class,
|
|
||||||
];
|
|
||||||
|
|
||||||
private VisitRepository $repo;
|
private VisitRepository $repo;
|
||||||
|
|
||||||
protected function setUp(): void
|
protected function beforeEach(): void
|
||||||
{
|
{
|
||||||
$this->repo = $this->getEntityManager()->getRepository(Visit::class);
|
$this->repo = $this->getEntityManager()->getRepository(Visit::class);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user