]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/api/controllers/links/PutLinkTest.php
namespacing: \Shaarli\History
[github/shaarli/Shaarli.git] / tests / api / controllers / links / PutLinkTest.php
index 8a5625710b5e924cda9d3c5146112b3d3851f353..3bb4d43f7f17dd7c5c45dbcaf413ffd16515b63c 100644 (file)
@@ -3,7 +3,6 @@
 
 namespace Shaarli\Api\Controllers;
 
-
 use Shaarli\Config\ConfigManager;
 use Slim\Container;
 use Slim\Http\Environment;
@@ -33,7 +32,7 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase
     protected $refDB = null;
 
     /**
-     * @var \History instance.
+     * @var \Shaarli\History instance.
      */
     protected $history;
 
@@ -63,12 +62,12 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase
 
         $refHistory = new \ReferenceHistory();
         $refHistory->write(self::$testHistory);
-        $this->history = new \History(self::$testHistory);
+        $this->history = new \Shaarli\History(self::$testHistory);
 
         $this->container = new Container();
         $this->container['conf'] = $this->conf;
         $this->container['db'] = new \LinkDB(self::$testDatastore, true, false);
-        $this->container['history'] = new \History(self::$testHistory);
+        $this->container['history'] = new \Shaarli\History(self::$testHistory);
 
         $this->controller = new Links($this->container);
 
@@ -115,10 +114,12 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase
             \DateTime::createFromFormat('Ymd_His', '20150310_114651'),
             \DateTime::createFromFormat(\DateTime::ATOM, $data['created'])
         );
-        $this->assertTrue(new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['updated']));
+        $this->assertTrue(
+            new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['updated'])
+        );
 
         $historyEntry = $this->history->getHistory()[0];
-        $this->assertEquals(\History::UPDATED, $historyEntry['event']);
+        $this->assertEquals(\Shaarli\History::UPDATED, $historyEntry['event']);
         $this->assertTrue(
             (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime']
         );
@@ -160,7 +161,9 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase
             \DateTime::createFromFormat('Ymd_His', '20150310_114651'),
             \DateTime::createFromFormat(\DateTime::ATOM, $data['created'])
         );
-        $this->assertTrue(new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['updated']));
+        $this->assertTrue(
+            new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['updated'])
+        );
     }
 
     /**