$this->publicLinkDB->add(new Bookmark());
}
- /**
- * Test add() method with an entry which is not a bookmark instance
- */
- public function testAddNotABookmark()
- {
- $this->expectException(\Exception::class);
- $this->expectExceptionMessage('Provided data is invalid');
-
- $this->privateLinkDB->add(['title' => 'hi!']);
- }
-
/**
* Test add() method with a Bookmark already containing an ID
*/
$this->publicLinkDB->set(new Bookmark());
}
- /**
- * Test set() method with an entry which is not a bookmark instance
- */
- public function testSetNotABookmark()
- {
- $this->expectException(\Exception::class);
- $this->expectExceptionMessage('Provided data is invalid');
-
- $this->privateLinkDB->set(['title' => 'hi!']);
- }
-
/**
* Test set() method with a Bookmark without an ID defined.
*/
$this->publicLinkDB->addOrSet(new Bookmark());
}
- /**
- * Test addOrSet() method with an entry which is not a bookmark instance
- */
- public function testAddOrSetNotABookmark()
- {
- $this->expectException(\Exception::class);
- $this->expectExceptionMessage('Provided data is invalid');
-
- $this->privateLinkDB->addOrSet(['title' => 'hi!']);
- }
-
/**
* Test addOrSet() method for a bookmark without any field set and without writing the data store
*/
$this->publicLinkDB->remove($bookmark);
}
- /**
- * Test remove() method with an entry which is not a bookmark instance
- */
- public function testRemoveNotABookmark()
- {
- $this->expectException(\Exception::class);
- $this->expectExceptionMessage('Provided data is invalid');
-
- $this->privateLinkDB->remove(['title' => 'hi!']);
- }
-
/**
* Test remove() method with a Bookmark with an unknown ID
*/
*/
public function testDays()
{
- $this->assertEquals(
+ $this->assertSame(
['20100309', '20100310', '20121206', '20121207', '20130614', '20150310'],
$this->publicLinkDB->days()
);
- $this->assertEquals(
+ $this->assertSame(
['20100309', '20100310', '20121206', '20121207', '20130614', '20141125', '20150310'],
$this->privateLinkDB->days()
);
// They need to be grouped with the first case found - order by date DESC: `sTuff`.
'sTuff' => 2,
'ut' => 1,
+ 'assurance' => 1,
+ 'coding-style' => 1,
+ 'quality' => 1,
+ 'standards' => 1,
],
$this->publicLinkDB->bookmarksCountPerTag()
);
'tag3' => 1,
'tag4' => 1,
'ut' => 1,
+ 'assurance' => 1,
+ 'coding-style' => 1,
+ 'quality' => 1,
+ 'standards' => 1,
],
$this->privateLinkDB->bookmarksCountPerTag()
);
'tag4' => 1,
'ut' => 1,
'w3c' => 1,
+ 'assurance' => 1,
+ 'coding-style' => 1,
+ 'quality' => 1,
+ 'standards' => 1,
];
$tags = $this->privateLinkDB->bookmarksCountPerTag();
'stallman' => 1,
'ut' => 1,
'w3c' => 1,
+ 'assurance' => 1,
+ 'coding-style' => 1,
+ 'quality' => 1,
+ 'standards' => 1,
];
$bookmark = new Bookmark();
$bookmark->setTags(['newTagToCount', BookmarkMarkdownFormatter::NO_MD_TAG]);