X-Git-Url: https://git.immae.eu/?p=github%2Fshaarli%2FShaarli.git;a=blobdiff_plain;f=tests%2Fbookmark%2FLinkDBTest.php;fp=tests%2FLinkDBTest.php;h=f18a3155bd060efdf0477dd7150cc6126176a614;hp=737a2247d03bd7404a9c9ca27961aecd79f596f1;hb=f24896b237e40718fb6eaa2869592eb0855a47fd;hpb=a0c4dbd91c41b9ecdd5176c1ac33b55e240d2392 diff --git a/tests/LinkDBTest.php b/tests/bookmark/LinkDBTest.php similarity index 97% rename from tests/LinkDBTest.php rename to tests/bookmark/LinkDBTest.php index 737a2247..f18a3155 100644 --- a/tests/LinkDBTest.php +++ b/tests/bookmark/LinkDBTest.php @@ -3,9 +3,15 @@ * 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'; @@ -13,7 +19,7 @@ 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'; @@ -73,7 +79,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase */ protected static function getMethod($name) { - $class = new ReflectionClass('LinkDB'); + $class = new ReflectionClass('Shaarli\Bookmark\LinkDB'); $method = $class->getMethod($name); $method->setAccessible(true); return $method; @@ -187,12 +193,12 @@ class LinkDBTest extends PHPUnit_Framework_TestCase $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');