Fixed error when filtering short URLs by ALL tags and search term

This commit is contained in:
Alejandro Celaya
2022-06-04 11:20:08 +02:00
parent 2b69f5eff4
commit de30c6ad79
3 changed files with 24 additions and 10 deletions

View File

@@ -125,9 +125,15 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
new ShortUrlsListFiltering(null, null, Ordering::emptyInstance(), 'foo', ['bar']),
);
self::assertCount(1, $result);
self::assertEquals(1, $this->repo->countList(new ShortUrlsCountFiltering('foo', ['bar'])));
self::assertSame($foo, $result[0]);
// Assert searched text also applies to tags
$result = $this->repo->findList(new ShortUrlsListFiltering(null, null, Ordering::emptyInstance(), 'bar'));
self::assertCount(2, $result);
self::assertContains($foo, $result);
self::assertEquals(1, $this->repo->countList(new ShortUrlsCountFiltering('foo', ['bar'])));
$result = $this->repo->findList(new ShortUrlsListFiltering(null, null, Ordering::emptyInstance()));
self::assertCount(3, $result);