* Link datastore tests
*/
+require_once 'application/Cache.php';
require_once 'application/LinkDB.php';
require_once 'application/Utils.php';
require_once 'tests/utils/ReferenceLinkDB.php';
'tags'=>'unit test'
);
$testDB[$link['linkdate']] = $link;
-
- // TODO: move PageCache to a proper class/file
- function invalidateCaches() {}
-
- $testDB->savedb();
+ $testDB->savedb('tests');
$testDB = new LinkDB(self::$testDatastore, true, false);
$this->assertEquals($dbSize + 1, sizeof($testDB));
public function testDays()
{
$this->assertEquals(
- ['20121206', '20130614', '20150310'],
+ array('20121206', '20130614', '20150310'),
self::$publicLinkDB->days()
);
$this->assertEquals(
- ['20121206', '20130614', '20141125', '20150310'],
+ array('20121206', '20130614', '20141125', '20150310'),
self::$privateLinkDB->days()
);
}
public function testAllTags()
{
$this->assertEquals(
- [
+ array(
'web' => 3,
'cartoon' => 2,
'gnu' => 2,
'software' => 1,
'stallman' => 1,
'free' => 1
- ],
+ ),
self::$publicLinkDB->allTags()
);
$this->assertEquals(
- [
+ array(
'web' => 4,
'cartoon' => 3,
'gnu' => 2,
'w3c' => 1,
'css' => 1,
'Mercurial' => 1
- ],
+ ),
self::$privateLinkDB->allTags()
);
}
);
}
}
-?>