diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-09-06 14:16:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-06 14:16:08 +0200 |
commit | e2dff28b44fafcf11a1db7985c50cd40e6945821 (patch) | |
tree | 844bad27383545afd8d73d85e432f9cb6a6104cc /tests/bookmark/BookmarkFileServiceTest.php | |
parent | 949a0953109c2738ecd973c44cd728cddc120164 (diff) | |
parent | 27ddfec3c3847f10ab0de246f4a174b751c5f19e (diff) | |
download | Shaarli-e2dff28b44fafcf11a1db7985c50cd40e6945821.tar.gz Shaarli-e2dff28b44fafcf11a1db7985c50cd40e6945821.tar.zst Shaarli-e2dff28b44fafcf11a1db7985c50cd40e6945821.zip |
Merge pull request #1547 from ArthurHoaro/fix/daily-visibility
Fix visibility issue on daily page
Diffstat (limited to 'tests/bookmark/BookmarkFileServiceTest.php')
-rw-r--r-- | tests/bookmark/BookmarkFileServiceTest.php | 30 |
1 files changed, 30 insertions, 0 deletions
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 | |||
@@ -1062,6 +1062,36 @@ class BookmarkFileServiceTest extends TestCase | |||
1062 | } | 1062 | } |
1063 | 1063 | ||
1064 | /** | 1064 | /** |
1065 | * Test filterDay while logged in | ||
1066 | */ | ||
1067 | public function testFilterDayLoggedIn(): void | ||
1068 | { | ||
1069 | $bookmarks = $this->privateLinkDB->filterDay('20121206'); | ||
1070 | $expectedIds = [4, 9, 1, 0]; | ||
1071 | |||
1072 | static::assertCount(4, $bookmarks); | ||
1073 | foreach ($bookmarks as $bookmark) { | ||
1074 | $i = ($i ?? -1) + 1; | ||
1075 | static::assertSame($expectedIds[$i], $bookmark->getId()); | ||
1076 | } | ||
1077 | } | ||
1078 | |||
1079 | /** | ||
1080 | * Test filterDay while logged out | ||
1081 | */ | ||
1082 | public function testFilterDayLoggedOut(): void | ||
1083 | { | ||
1084 | $bookmarks = $this->publicLinkDB->filterDay('20121206'); | ||
1085 | $expectedIds = [4, 9, 1]; | ||
1086 | |||
1087 | static::assertCount(3, $bookmarks); | ||
1088 | foreach ($bookmarks as $bookmark) { | ||
1089 | $i = ($i ?? -1) + 1; | ||
1090 | static::assertSame($expectedIds[$i], $bookmark->getId()); | ||
1091 | } | ||
1092 | } | ||
1093 | |||
1094 | /** | ||
1065 | * Allows to test LinkDB's private methods | 1095 | * Allows to test LinkDB's private methods |
1066 | * | 1096 | * |
1067 | * @see | 1097 | * @see |