aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/api/controllers/links
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2018-12-02 23:24:58 +0100
committerVirtualTam <virtualtam@flibidi.net>2019-01-12 22:47:48 +0100
commitbdc5152d486ca75372c271f94623b248bc127800 (patch)
tree45012b55c96215f83dc863882717822ce5aa9e25 /tests/api/controllers/links
parent1826e383ecf501302974132fd443cf1ca06e10f6 (diff)
downloadShaarli-bdc5152d486ca75372c271f94623b248bc127800.tar.gz
Shaarli-bdc5152d486ca75372c271f94623b248bc127800.tar.zst
Shaarli-bdc5152d486ca75372c271f94623b248bc127800.zip
namespacing: \Shaarli\History
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'tests/api/controllers/links')
-rw-r--r--tests/api/controllers/links/DeleteLinkTest.php6
-rw-r--r--tests/api/controllers/links/PostLinkTest.php8
-rw-r--r--tests/api/controllers/links/PutLinkTest.php8
3 files changed, 11 insertions, 11 deletions
diff --git a/tests/api/controllers/links/DeleteLinkTest.php b/tests/api/controllers/links/DeleteLinkTest.php
index 7d797137..07371e7a 100644
--- a/tests/api/controllers/links/DeleteLinkTest.php
+++ b/tests/api/controllers/links/DeleteLinkTest.php
@@ -37,7 +37,7 @@ class DeleteLinkTest extends \PHPUnit_Framework_TestCase
37 protected $linkDB; 37 protected $linkDB;
38 38
39 /** 39 /**
40 * @var \History instance. 40 * @var \Shaarli\History instance.
41 */ 41 */
42 protected $history; 42 protected $history;
43 43
@@ -62,7 +62,7 @@ class DeleteLinkTest extends \PHPUnit_Framework_TestCase
62 $this->linkDB = new \LinkDB(self::$testDatastore, true, false); 62 $this->linkDB = new \LinkDB(self::$testDatastore, true, false);
63 $refHistory = new \ReferenceHistory(); 63 $refHistory = new \ReferenceHistory();
64 $refHistory->write(self::$testHistory); 64 $refHistory->write(self::$testHistory);
65 $this->history = new \History(self::$testHistory); 65 $this->history = new \Shaarli\History(self::$testHistory);
66 $this->container = new Container(); 66 $this->container = new Container();
67 $this->container['conf'] = $this->conf; 67 $this->container['conf'] = $this->conf;
68 $this->container['db'] = $this->linkDB; 68 $this->container['db'] = $this->linkDB;
@@ -100,7 +100,7 @@ class DeleteLinkTest extends \PHPUnit_Framework_TestCase
100 $this->assertFalse(isset($this->linkDB[$id])); 100 $this->assertFalse(isset($this->linkDB[$id]));
101 101
102 $historyEntry = $this->history->getHistory()[0]; 102 $historyEntry = $this->history->getHistory()[0];
103 $this->assertEquals(\History::DELETED, $historyEntry['event']); 103 $this->assertEquals(\Shaarli\History::DELETED, $historyEntry['event']);
104 $this->assertTrue( 104 $this->assertTrue(
105 (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime'] 105 (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime']
106 ); 106 );
diff --git a/tests/api/controllers/links/PostLinkTest.php b/tests/api/controllers/links/PostLinkTest.php
index 5c2b5623..a73f443c 100644
--- a/tests/api/controllers/links/PostLinkTest.php
+++ b/tests/api/controllers/links/PostLinkTest.php
@@ -40,7 +40,7 @@ class PostLinkTest extends TestCase
40 protected $refDB = null; 40 protected $refDB = null;
41 41
42 /** 42 /**
43 * @var \History instance. 43 * @var \Shaarli\History instance.
44 */ 44 */
45 protected $history; 45 protected $history;
46 46
@@ -70,12 +70,12 @@ class PostLinkTest extends TestCase
70 70
71 $refHistory = new \ReferenceHistory(); 71 $refHistory = new \ReferenceHistory();
72 $refHistory->write(self::$testHistory); 72 $refHistory->write(self::$testHistory);
73 $this->history = new \History(self::$testHistory); 73 $this->history = new \Shaarli\History(self::$testHistory);
74 74
75 $this->container = new Container(); 75 $this->container = new Container();
76 $this->container['conf'] = $this->conf; 76 $this->container['conf'] = $this->conf;
77 $this->container['db'] = new \LinkDB(self::$testDatastore, true, false); 77 $this->container['db'] = new \LinkDB(self::$testDatastore, true, false);
78 $this->container['history'] = new \History(self::$testHistory); 78 $this->container['history'] = new \Shaarli\History(self::$testHistory);
79 79
80 $this->controller = new Links($this->container); 80 $this->controller = new Links($this->container);
81 81
@@ -133,7 +133,7 @@ class PostLinkTest extends TestCase
133 $this->assertEquals('', $data['updated']); 133 $this->assertEquals('', $data['updated']);
134 134
135 $historyEntry = $this->history->getHistory()[0]; 135 $historyEntry = $this->history->getHistory()[0];
136 $this->assertEquals(\History::CREATED, $historyEntry['event']); 136 $this->assertEquals(\Shaarli\History::CREATED, $historyEntry['event']);
137 $this->assertTrue( 137 $this->assertTrue(
138 (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime'] 138 (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime']
139 ); 139 );
diff --git a/tests/api/controllers/links/PutLinkTest.php b/tests/api/controllers/links/PutLinkTest.php
index f276b4c1..3bb4d43f 100644
--- a/tests/api/controllers/links/PutLinkTest.php
+++ b/tests/api/controllers/links/PutLinkTest.php
@@ -32,7 +32,7 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase
32 protected $refDB = null; 32 protected $refDB = null;
33 33
34 /** 34 /**
35 * @var \History instance. 35 * @var \Shaarli\History instance.
36 */ 36 */
37 protected $history; 37 protected $history;
38 38
@@ -62,12 +62,12 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase
62 62
63 $refHistory = new \ReferenceHistory(); 63 $refHistory = new \ReferenceHistory();
64 $refHistory->write(self::$testHistory); 64 $refHistory->write(self::$testHistory);
65 $this->history = new \History(self::$testHistory); 65 $this->history = new \Shaarli\History(self::$testHistory);
66 66
67 $this->container = new Container(); 67 $this->container = new Container();
68 $this->container['conf'] = $this->conf; 68 $this->container['conf'] = $this->conf;
69 $this->container['db'] = new \LinkDB(self::$testDatastore, true, false); 69 $this->container['db'] = new \LinkDB(self::$testDatastore, true, false);
70 $this->container['history'] = new \History(self::$testHistory); 70 $this->container['history'] = new \Shaarli\History(self::$testHistory);
71 71
72 $this->controller = new Links($this->container); 72 $this->controller = new Links($this->container);
73 73
@@ -119,7 +119,7 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase
119 ); 119 );
120 120
121 $historyEntry = $this->history->getHistory()[0]; 121 $historyEntry = $this->history->getHistory()[0];
122 $this->assertEquals(\History::UPDATED, $historyEntry['event']); 122 $this->assertEquals(\Shaarli\History::UPDATED, $historyEntry['event']);
123 $this->assertTrue( 123 $this->assertTrue(
124 (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime'] 124 (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime']
125 ); 125 );