Update to latest test utils

This commit is contained in:
Alejandro Celaya
2024-11-09 11:02:10 +01:00
parent 1a278eaf07
commit 95685d958d
6 changed files with 6 additions and 10 deletions

View File

@@ -73,7 +73,7 @@
"phpunit/phpunit": "^11.4",
"roave/security-advisories": "dev-master",
"shlinkio/php-coding-standard": "~2.4.0",
"shlinkio/shlink-test-utils": "^4.1.1",
"shlinkio/shlink-test-utils": "^4.2",
"symfony/var-dumper": "^7.1",
"veewee/composer-run-parallel": "^1.4"
},

View File

@@ -16,8 +16,7 @@ class CrawlableShortCodesQueryTest extends DatabaseTestCase
protected function setUp(): void
{
$em = $this->getEntityManager();
$this->query = new CrawlableShortCodesQuery($em, $em->getClassMetadata(ShortUrl::class));
$this->query = $this->createRepository(ShortUrl::class, CrawlableShortCodesQuery::class);
}
#[Test]

View File

@@ -22,8 +22,7 @@ class DeleteExpiredShortUrlsRepositoryTest extends DatabaseTestCase
protected function setUp(): void
{
$em = $this->getEntityManager();
$this->repository = new ExpiredShortUrlsRepository($em, $em->getClassMetadata(ShortUrl::class));
$this->repository = $this->createRepository(ShortUrl::class, ExpiredShortUrlsRepository::class);
}
#[Test]

View File

@@ -37,7 +37,7 @@ class ShortUrlListRepositoryTest extends DatabaseTestCase
protected function setUp(): void
{
$em = $this->getEntityManager();
$this->repo = new ShortUrlListRepository($em, $em->getClassMetadata(ShortUrl::class));
$this->repo = $this->createRepository(ShortUrl::class, ShortUrlListRepository::class);
$this->relationResolver = new PersistenceShortUrlRelationResolver($em);
}

View File

@@ -20,8 +20,7 @@ class VisitDeleterRepositoryTest extends DatabaseTestCase
protected function setUp(): void
{
$em = $this->getEntityManager();
$this->repo = new VisitDeleterRepository($em, $em->getClassMetadata(Visit::class));
$this->repo = $this->createRepository(Visit::class, VisitDeleterRepository::class);
}
#[Test]

View File

@@ -25,8 +25,7 @@ class VisitIterationRepositoryTest extends DatabaseTestCase
protected function setUp(): void
{
$em = $this->getEntityManager();
$this->repo = new VisitIterationRepository($em, $em->getClassMetadata(Visit::class));
$this->repo = $this->createRepository(Visit::class, VisitIterationRepository::class);
}
#[Test, DataProvider('provideBlockSize')]