mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-23 07:33:58 -06:00
Enhanced db tests for expired short urls filtering
This commit is contained in:
parent
cdde59b543
commit
d832133410
@ -82,11 +82,6 @@ class ShortUrlRepository extends EntitySpecificationRepository implements ShortU
|
||||
$qb->select('COUNT(DISTINCT s)');
|
||||
$query = $qb->getQuery();
|
||||
|
||||
// TODO Check if this is needed
|
||||
// if ($filtering->excludeMaxVisitsReached) {
|
||||
// $qb->addSelect('COUNT(DISTINCT v)');
|
||||
// }
|
||||
|
||||
// TODO This is crap...
|
||||
return $filtering->excludeMaxVisitsReached
|
||||
? count($query->getSingleColumnResult())
|
||||
|
@ -378,9 +378,13 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
|
||||
);
|
||||
|
||||
self::assertCount(4, $this->repo->findList($filtering(false, false)));
|
||||
self::assertEquals(4, $this->repo->countList($filtering(false, false)));
|
||||
self::assertCount(3, $this->repo->findList($filtering(true, false)));
|
||||
self::assertEquals(3, $this->repo->countList($filtering(true, false)));
|
||||
self::assertCount(3, $this->repo->findList($filtering(false, true)));
|
||||
self::assertEquals(3, $this->repo->countList($filtering(false, true)));
|
||||
self::assertCount(2, $this->repo->findList($filtering(true, true)));
|
||||
self::assertEquals(2, $this->repo->countList($filtering(true, true)));
|
||||
}
|
||||
|
||||
/** @test */
|
||||
|
Loading…
Reference in New Issue
Block a user