* - by tag,
* - by text,
* - etc.
- */
- public static function setUpBeforeClass()
- {
- self::$refDB = new ReferenceLinkDB();
- self::$refDB->write(self::$testDatastore);
-
- self::$publicLinkDB = new LinkDB(self::$testDatastore, false, false);
- self::$privateLinkDB = new LinkDB(self::$testDatastore, true, false);
- }
-
- /**
+ *
* Resets test data for each test
*/
protected function setUp()
if (file_exists(self::$testDatastore)) {
unlink(self::$testDatastore);
}
+
+ self::$refDB = new ReferenceLinkDB();
+ self::$refDB->write(self::$testDatastore);
+
+ self::$publicLinkDB = new LinkDB(self::$testDatastore, false, false);
+ self::$privateLinkDB = new LinkDB(self::$testDatastore, true, false);
}
/**
$dbSize = sizeof($testDB);
$link = array(
- 'id' => 42,
+ 'id' => 43,
'title' => 'an additional link',
'url' => 'http://dum.my',
'description' => 'One more',
*/
public function testConsistentOrder()
{
- $nextId = 42;
+ $nextId = 43;
$creation = DateTime::createFromFormat('Ymd_His', '20190807_130444');
$linkDB = new LinkDB(self::$testDatastore, true, false);
for ($i = 0; $i < 4; ++$i) {
$linkDB = new LinkDB(self::$testDatastore, true, false);
$count = 3;
foreach ($linkDB as $link) {
+ if ($link['sticky'] === true) {
+ continue;
+ }
$this->assertEquals($nextId + $count, $link['id']);
$this->assertEquals('http://'. $count, $link['url']);
if (--$count < 0) {