aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LinkDBTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/LinkDBTest.php')
-rw-r--r--tests/LinkDBTest.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php
index bedc680e..1f62a34a 100644
--- a/tests/LinkDBTest.php
+++ b/tests/LinkDBTest.php
@@ -191,7 +191,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
191 'url'=>'http://dum.my', 191 'url'=>'http://dum.my',
192 'description'=>'One more', 192 'description'=>'One more',
193 'private'=>0, 193 'private'=>0,
194 'created'=> DateTime::createFromFormat('Ymd_His', '20150518_190000'), 194 'created'=> DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150518_190000'),
195 'tags'=>'unit test' 195 'tags'=>'unit test'
196 ); 196 );
197 $testDB[$link['id']] = $link; 197 $testDB[$link['id']] = $link;
@@ -447,17 +447,17 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
447 */ 447 */
448 public function testReorderLinksDesc() 448 public function testReorderLinksDesc()
449 { 449 {
450 self::$publicLinkDB->reorder('ASC'); 450 self::$privateLinkDB->reorder('ASC');
451 $linkIdToTest = 42; 451 $linkIds = array(42, 4, 1, 0, 7, 6, 8, 41);
452 foreach (self::$publicLinkDB as $key => $value) { 452 $cpt = 0;
453 $this->assertEquals($linkIdToTest, $key); 453 foreach (self::$privateLinkDB as $key => $value) {
454 break; 454 $this->assertEquals($linkIds[$cpt++], $key);
455 } 455 }
456 self::$publicLinkDB->reorder('DESC'); 456 self::$privateLinkDB->reorder('DESC');
457 $linkIdToTest = 41; 457 $linkIds = array_reverse($linkIds);
458 foreach (self::$publicLinkDB as $key => $value) { 458 $cpt = 0;
459 $this->assertEquals($linkIdToTest, $key); 459 foreach (self::$privateLinkDB as $key => $value) {
460 break; 460 $this->assertEquals($linkIds[$cpt++], $key);
461 } 461 }
462 } 462 }
463} 463}