diff options
Diffstat (limited to 'tests/LinkDBTest.php')
-rw-r--r-- | tests/LinkDBTest.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php index 3b980878..fcab76f6 100644 --- a/tests/LinkDBTest.php +++ b/tests/LinkDBTest.php | |||
@@ -239,12 +239,12 @@ class LinkDBTest extends PHPUnit_Framework_TestCase | |||
239 | public function testDays() | 239 | public function testDays() |
240 | { | 240 | { |
241 | $this->assertEquals( | 241 | $this->assertEquals( |
242 | array('20100310', '20121206', '20130614', '20150310'), | 242 | array('20100309', '20100310', '20121206', '20121207', '20130614', '20150310'), |
243 | self::$publicLinkDB->days() | 243 | self::$publicLinkDB->days() |
244 | ); | 244 | ); |
245 | 245 | ||
246 | $this->assertEquals( | 246 | $this->assertEquals( |
247 | array('20100310', '20121206', '20130614', '20141125', '20150310'), | 247 | array('20100309', '20100310', '20121206', '20121207', '20130614', '20141125', '20150310'), |
248 | self::$privateLinkDB->days() | 248 | self::$privateLinkDB->days() |
249 | ); | 249 | ); |
250 | } | 250 | } |
@@ -475,13 +475,15 @@ class LinkDBTest extends PHPUnit_Framework_TestCase | |||
475 | public function testReorderLinksDesc() | 475 | public function testReorderLinksDesc() |
476 | { | 476 | { |
477 | self::$privateLinkDB->reorder('ASC'); | 477 | self::$privateLinkDB->reorder('ASC'); |
478 | $linkIds = array(42, 4, 9, 1, 0, 7, 6, 8, 41); | 478 | $stickyIds = [11, 10]; |
479 | $standardIds = [42, 4, 9, 1, 0, 7, 6, 8, 41]; | ||
480 | $linkIds = array_merge($stickyIds, $standardIds); | ||
479 | $cpt = 0; | 481 | $cpt = 0; |
480 | foreach (self::$privateLinkDB as $key => $value) { | 482 | foreach (self::$privateLinkDB as $key => $value) { |
481 | $this->assertEquals($linkIds[$cpt++], $key); | 483 | $this->assertEquals($linkIds[$cpt++], $key); |
482 | } | 484 | } |
483 | self::$privateLinkDB->reorder('DESC'); | 485 | self::$privateLinkDB->reorder('DESC'); |
484 | $linkIds = array_reverse($linkIds); | 486 | $linkIds = array_merge(array_reverse($stickyIds), array_reverse($standardIds)); |
485 | $cpt = 0; | 487 | $cpt = 0; |
486 | foreach (self::$privateLinkDB as $key => $value) { | 488 | foreach (self::$privateLinkDB as $key => $value) { |
487 | $this->assertEquals($linkIds[$cpt++], $key); | 489 | $this->assertEquals($linkIds[$cpt++], $key); |