From 27ddfec3c3847f10ab0de246f4a174b751c5f19e Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 6 Sep 2020 14:11:02 +0200 Subject: Fix visibility issue on daily page This filter (links by day) didn't apply any visibility parameter. Fixes #1543 --- tests/bookmark/BookmarkFileServiceTest.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tests/bookmark/BookmarkFileServiceTest.php') diff --git a/tests/bookmark/BookmarkFileServiceTest.php b/tests/bookmark/BookmarkFileServiceTest.php index 7b1906d3..c59fd443 100644 --- a/tests/bookmark/BookmarkFileServiceTest.php +++ b/tests/bookmark/BookmarkFileServiceTest.php @@ -1061,6 +1061,36 @@ class BookmarkFileServiceTest extends TestCase $this->assertEquals($expected, $tags, var_export($tags, true)); } + /** + * Test filterDay while logged in + */ + public function testFilterDayLoggedIn(): void + { + $bookmarks = $this->privateLinkDB->filterDay('20121206'); + $expectedIds = [4, 9, 1, 0]; + + static::assertCount(4, $bookmarks); + foreach ($bookmarks as $bookmark) { + $i = ($i ?? -1) + 1; + static::assertSame($expectedIds[$i], $bookmark->getId()); + } + } + + /** + * Test filterDay while logged out + */ + public function testFilterDayLoggedOut(): void + { + $bookmarks = $this->publicLinkDB->filterDay('20121206'); + $expectedIds = [4, 9, 1]; + + static::assertCount(3, $bookmarks); + foreach ($bookmarks as $bookmark) { + $i = ($i ?? -1) + 1; + static::assertSame($expectedIds[$i], $bookmark->getId()); + } + } + /** * Allows to test LinkDB's private methods * -- cgit v1.2.3