diff options
Diffstat (limited to 'tests/api/controllers/links/PutLinkTest.php')
-rw-r--r-- | tests/api/controllers/links/PutLinkTest.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/api/controllers/links/PutLinkTest.php b/tests/api/controllers/links/PutLinkTest.php index eb6c7955..cd815b66 100644 --- a/tests/api/controllers/links/PutLinkTest.php +++ b/tests/api/controllers/links/PutLinkTest.php | |||
@@ -4,12 +4,13 @@ | |||
4 | namespace Shaarli\Api\Controllers; | 4 | namespace Shaarli\Api\Controllers; |
5 | 5 | ||
6 | use Shaarli\Config\ConfigManager; | 6 | use Shaarli\Config\ConfigManager; |
7 | use Shaarli\History; | ||
7 | use Slim\Container; | 8 | use Slim\Container; |
8 | use Slim\Http\Environment; | 9 | use Slim\Http\Environment; |
9 | use Slim\Http\Request; | 10 | use Slim\Http\Request; |
10 | use Slim\Http\Response; | 11 | use Slim\Http\Response; |
11 | 12 | ||
12 | class PutLinkTest extends \PHPUnit_Framework_TestCase | 13 | class PutLinkTest extends \PHPUnit\Framework\TestCase |
13 | { | 14 | { |
14 | /** | 15 | /** |
15 | * @var string datastore to test write operations | 16 | * @var string datastore to test write operations |
@@ -32,7 +33,7 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase | |||
32 | protected $refDB = null; | 33 | protected $refDB = null; |
33 | 34 | ||
34 | /** | 35 | /** |
35 | * @var \Shaarli\History instance. | 36 | * @var HistoryController instance. |
36 | */ | 37 | */ |
37 | protected $history; | 38 | protected $history; |
38 | 39 | ||
@@ -62,12 +63,12 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase | |||
62 | 63 | ||
63 | $refHistory = new \ReferenceHistory(); | 64 | $refHistory = new \ReferenceHistory(); |
64 | $refHistory->write(self::$testHistory); | 65 | $refHistory->write(self::$testHistory); |
65 | $this->history = new \Shaarli\History(self::$testHistory); | 66 | $this->history = new History(self::$testHistory); |
66 | 67 | ||
67 | $this->container = new Container(); | 68 | $this->container = new Container(); |
68 | $this->container['conf'] = $this->conf; | 69 | $this->container['conf'] = $this->conf; |
69 | $this->container['db'] = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false); | 70 | $this->container['db'] = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false); |
70 | $this->container['history'] = new \Shaarli\History(self::$testHistory); | 71 | $this->container['history'] = new History(self::$testHistory); |
71 | 72 | ||
72 | $this->controller = new Links($this->container); | 73 | $this->controller = new Links($this->container); |
73 | 74 | ||
@@ -119,7 +120,7 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase | |||
119 | ); | 120 | ); |
120 | 121 | ||
121 | $historyEntry = $this->history->getHistory()[0]; | 122 | $historyEntry = $this->history->getHistory()[0]; |
122 | $this->assertEquals(\Shaarli\History::UPDATED, $historyEntry['event']); | 123 | $this->assertEquals(History::UPDATED, $historyEntry['event']); |
123 | $this->assertTrue( | 124 | $this->assertTrue( |
124 | (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime'] | 125 | (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime'] |
125 | ); | 126 | ); |