* Link datastore tests
*/
+namespace Shaarli\Bookmark;
+
+use DateTime;
+use LinkNotFoundException;
+use ReferenceLinkDB;
+use ReflectionClass;
+use Shaarli;
+
require_once 'application/feed/Cache.php';
-require_once 'application/FileUtils.php';
-require_once 'application/LinkDB.php';
require_once 'application/Utils.php';
require_once 'tests/utils/ReferenceLinkDB.php';
/**
* Unitary tests for LinkDB
*/
-class LinkDBTest extends PHPUnit_Framework_TestCase
+class LinkDBTest extends \PHPUnit\Framework\TestCase
{
// datastore to test write operations
protected static $testDatastore = 'sandbox/datastore.php';
*/
protected static function getMethod($name)
{
- $class = new ReflectionClass('LinkDB');
+ $class = new ReflectionClass('Shaarli\Bookmark\LinkDB');
$method = $class->getMethod($name);
$method->setAccessible(true);
return $method;
$link = array(
'id' => 42,
- 'title'=>'an additional link',
- 'url'=>'http://dum.my',
- 'description'=>'One more',
- 'private'=>0,
- 'created'=> DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150518_190000'),
- 'tags'=>'unit test'
+ 'title' => 'an additional link',
+ 'url' => 'http://dum.my',
+ 'description' => 'One more',
+ 'private' => 0,
+ 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150518_190000'),
+ 'tags' => 'unit test'
);
$testDB[$link['id']] = $link;
$testDB->save('tests');