diff options
author | VirtualTam <virtualtam@flibidi.net> | 2018-12-03 01:10:39 +0100 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2019-01-12 22:47:48 +0100 |
commit | f24896b237e40718fb6eaa2869592eb0855a47fd (patch) | |
tree | 32ca9a3e096981840426a9b762d57ec8db2ecbee /tests/api | |
parent | a0c4dbd91c41b9ecdd5176c1ac33b55e240d2392 (diff) | |
download | Shaarli-f24896b237e40718fb6eaa2869592eb0855a47fd.tar.gz Shaarli-f24896b237e40718fb6eaa2869592eb0855a47fd.tar.zst Shaarli-f24896b237e40718fb6eaa2869592eb0855a47fd.zip |
namespacing: \Shaarli\Bookmark\LinkDB
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'tests/api')
-rw-r--r-- | tests/api/controllers/info/InfoTest.php | 2 | ||||
-rw-r--r-- | tests/api/controllers/links/DeleteLinkTest.php | 6 | ||||
-rw-r--r-- | tests/api/controllers/links/GetLinkIdTest.php | 4 | ||||
-rw-r--r-- | tests/api/controllers/links/GetLinksTest.php | 6 | ||||
-rw-r--r-- | tests/api/controllers/links/PostLinkTest.php | 6 | ||||
-rw-r--r-- | tests/api/controllers/links/PutLinkTest.php | 6 | ||||
-rw-r--r-- | tests/api/controllers/tags/DeleteTagTest.php | 8 | ||||
-rw-r--r-- | tests/api/controllers/tags/GetTagNameTest.php | 2 | ||||
-rw-r--r-- | tests/api/controllers/tags/GetTagsTest.php | 4 | ||||
-rw-r--r-- | tests/api/controllers/tags/PutTagTest.php | 4 |
10 files changed, 24 insertions, 24 deletions
diff --git a/tests/api/controllers/info/InfoTest.php b/tests/api/controllers/info/InfoTest.php index e437082a..44a9382e 100644 --- a/tests/api/controllers/info/InfoTest.php +++ b/tests/api/controllers/info/InfoTest.php | |||
@@ -53,7 +53,7 @@ class InfoTest extends \PHPUnit_Framework_TestCase | |||
53 | 53 | ||
54 | $this->container = new Container(); | 54 | $this->container = new Container(); |
55 | $this->container['conf'] = $this->conf; | 55 | $this->container['conf'] = $this->conf; |
56 | $this->container['db'] = new \LinkDB(self::$testDatastore, true, false); | 56 | $this->container['db'] = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false); |
57 | $this->container['history'] = null; | 57 | $this->container['history'] = null; |
58 | 58 | ||
59 | $this->controller = new Info($this->container); | 59 | $this->controller = new Info($this->container); |
diff --git a/tests/api/controllers/links/DeleteLinkTest.php b/tests/api/controllers/links/DeleteLinkTest.php index 07371e7a..adca9a4e 100644 --- a/tests/api/controllers/links/DeleteLinkTest.php +++ b/tests/api/controllers/links/DeleteLinkTest.php | |||
@@ -32,7 +32,7 @@ class DeleteLinkTest extends \PHPUnit_Framework_TestCase | |||
32 | protected $refDB = null; | 32 | protected $refDB = null; |
33 | 33 | ||
34 | /** | 34 | /** |
35 | * @var \LinkDB instance. | 35 | * @var \Shaarli\Bookmark\LinkDB instance. |
36 | */ | 36 | */ |
37 | protected $linkDB; | 37 | protected $linkDB; |
38 | 38 | ||
@@ -59,7 +59,7 @@ class DeleteLinkTest extends \PHPUnit_Framework_TestCase | |||
59 | $this->conf = new ConfigManager('tests/utils/config/configJson'); | 59 | $this->conf = new ConfigManager('tests/utils/config/configJson'); |
60 | $this->refDB = new \ReferenceLinkDB(); | 60 | $this->refDB = new \ReferenceLinkDB(); |
61 | $this->refDB->write(self::$testDatastore); | 61 | $this->refDB->write(self::$testDatastore); |
62 | $this->linkDB = new \LinkDB(self::$testDatastore, true, false); | 62 | $this->linkDB = new \Shaarli\Bookmark\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 \Shaarli\History(self::$testHistory); | 65 | $this->history = new \Shaarli\History(self::$testHistory); |
@@ -96,7 +96,7 @@ class DeleteLinkTest extends \PHPUnit_Framework_TestCase | |||
96 | $this->assertEquals(204, $response->getStatusCode()); | 96 | $this->assertEquals(204, $response->getStatusCode()); |
97 | $this->assertEmpty((string) $response->getBody()); | 97 | $this->assertEmpty((string) $response->getBody()); |
98 | 98 | ||
99 | $this->linkDB = new \LinkDB(self::$testDatastore, true, false); | 99 | $this->linkDB = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false); |
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]; |
diff --git a/tests/api/controllers/links/GetLinkIdTest.php b/tests/api/controllers/links/GetLinkIdTest.php index 57528d5a..bf58000b 100644 --- a/tests/api/controllers/links/GetLinkIdTest.php +++ b/tests/api/controllers/links/GetLinkIdTest.php | |||
@@ -61,7 +61,7 @@ class GetLinkIdTest extends \PHPUnit_Framework_TestCase | |||
61 | 61 | ||
62 | $this->container = new Container(); | 62 | $this->container = new Container(); |
63 | $this->container['conf'] = $this->conf; | 63 | $this->container['conf'] = $this->conf; |
64 | $this->container['db'] = new \LinkDB(self::$testDatastore, true, false); | 64 | $this->container['db'] = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false); |
65 | $this->container['history'] = null; | 65 | $this->container['history'] = null; |
66 | 66 | ||
67 | $this->controller = new Links($this->container); | 67 | $this->controller = new Links($this->container); |
@@ -108,7 +108,7 @@ class GetLinkIdTest extends \PHPUnit_Framework_TestCase | |||
108 | $this->assertEquals('sTuff', $data['tags'][0]); | 108 | $this->assertEquals('sTuff', $data['tags'][0]); |
109 | $this->assertEquals(false, $data['private']); | 109 | $this->assertEquals(false, $data['private']); |
110 | $this->assertEquals( | 110 | $this->assertEquals( |
111 | \DateTime::createFromFormat(\LinkDB::LINK_DATE_FORMAT, '20150310_114651')->format(\DateTime::ATOM), | 111 | \DateTime::createFromFormat(\Shaarli\Bookmark\LinkDB::LINK_DATE_FORMAT, '20150310_114651')->format(\DateTime::ATOM), |
112 | $data['created'] | 112 | $data['created'] |
113 | ); | 113 | ); |
114 | $this->assertEmpty($data['updated']); | 114 | $this->assertEmpty($data['updated']); |
diff --git a/tests/api/controllers/links/GetLinksTest.php b/tests/api/controllers/links/GetLinksTest.php index 64f02774..1008d7b2 100644 --- a/tests/api/controllers/links/GetLinksTest.php +++ b/tests/api/controllers/links/GetLinksTest.php | |||
@@ -60,7 +60,7 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase | |||
60 | 60 | ||
61 | $this->container = new Container(); | 61 | $this->container = new Container(); |
62 | $this->container['conf'] = $this->conf; | 62 | $this->container['conf'] = $this->conf; |
63 | $this->container['db'] = new \LinkDB(self::$testDatastore, true, false); | 63 | $this->container['db'] = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false); |
64 | $this->container['history'] = null; | 64 | $this->container['history'] = null; |
65 | 65 | ||
66 | $this->controller = new Links($this->container); | 66 | $this->controller = new Links($this->container); |
@@ -114,7 +114,7 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase | |||
114 | $this->assertEquals('sTuff', $first['tags'][0]); | 114 | $this->assertEquals('sTuff', $first['tags'][0]); |
115 | $this->assertEquals(false, $first['private']); | 115 | $this->assertEquals(false, $first['private']); |
116 | $this->assertEquals( | 116 | $this->assertEquals( |
117 | \DateTime::createFromFormat(\LinkDB::LINK_DATE_FORMAT, '20150310_114651')->format(\DateTime::ATOM), | 117 | \DateTime::createFromFormat(\Shaarli\Bookmark\LinkDB::LINK_DATE_FORMAT, '20150310_114651')->format(\DateTime::ATOM), |
118 | $first['created'] | 118 | $first['created'] |
119 | ); | 119 | ); |
120 | $this->assertEmpty($first['updated']); | 120 | $this->assertEmpty($first['updated']); |
@@ -125,7 +125,7 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase | |||
125 | 125 | ||
126 | // Update date | 126 | // Update date |
127 | $this->assertEquals( | 127 | $this->assertEquals( |
128 | \DateTime::createFromFormat(\LinkDB::LINK_DATE_FORMAT, '20160803_093033')->format(\DateTime::ATOM), | 128 | \DateTime::createFromFormat(\Shaarli\Bookmark\LinkDB::LINK_DATE_FORMAT, '20160803_093033')->format(\DateTime::ATOM), |
129 | $link['updated'] | 129 | $link['updated'] |
130 | ); | 130 | ); |
131 | } | 131 | } |
diff --git a/tests/api/controllers/links/PostLinkTest.php b/tests/api/controllers/links/PostLinkTest.php index a73f443c..ade07eeb 100644 --- a/tests/api/controllers/links/PostLinkTest.php +++ b/tests/api/controllers/links/PostLinkTest.php | |||
@@ -74,7 +74,7 @@ class PostLinkTest extends TestCase | |||
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 \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false); |
78 | $this->container['history'] = new \Shaarli\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); |
@@ -210,11 +210,11 @@ class PostLinkTest extends TestCase | |||
210 | $this->assertEquals(['gnu', 'media', 'web', '.hidden', 'hashtag'], $data['tags']); | 210 | $this->assertEquals(['gnu', 'media', 'web', '.hidden', 'hashtag'], $data['tags']); |
211 | $this->assertEquals(false, $data['private']); | 211 | $this->assertEquals(false, $data['private']); |
212 | $this->assertEquals( | 212 | $this->assertEquals( |
213 | \DateTime::createFromFormat(\LinkDB::LINK_DATE_FORMAT, '20130614_184135'), | 213 | \DateTime::createFromFormat(\Shaarli\Bookmark\LinkDB::LINK_DATE_FORMAT, '20130614_184135'), |
214 | \DateTime::createFromFormat(\DateTime::ATOM, $data['created']) | 214 | \DateTime::createFromFormat(\DateTime::ATOM, $data['created']) |
215 | ); | 215 | ); |
216 | $this->assertEquals( | 216 | $this->assertEquals( |
217 | \DateTime::createFromFormat(\LinkDB::LINK_DATE_FORMAT, '20130615_184230'), | 217 | \DateTime::createFromFormat(\Shaarli\Bookmark\LinkDB::LINK_DATE_FORMAT, '20130615_184230'), |
218 | \DateTime::createFromFormat(\DateTime::ATOM, $data['updated']) | 218 | \DateTime::createFromFormat(\DateTime::ATOM, $data['updated']) |
219 | ); | 219 | ); |
220 | } | 220 | } |
diff --git a/tests/api/controllers/links/PutLinkTest.php b/tests/api/controllers/links/PutLinkTest.php index 3bb4d43f..eb6c7955 100644 --- a/tests/api/controllers/links/PutLinkTest.php +++ b/tests/api/controllers/links/PutLinkTest.php | |||
@@ -66,7 +66,7 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase | |||
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 \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false); |
70 | $this->container['history'] = new \Shaarli\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); |
@@ -198,11 +198,11 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase | |||
198 | $this->assertEquals(['gnu', 'media', 'web', '.hidden', 'hashtag'], $data['tags']); | 198 | $this->assertEquals(['gnu', 'media', 'web', '.hidden', 'hashtag'], $data['tags']); |
199 | $this->assertEquals(false, $data['private']); | 199 | $this->assertEquals(false, $data['private']); |
200 | $this->assertEquals( | 200 | $this->assertEquals( |
201 | \DateTime::createFromFormat(\LinkDB::LINK_DATE_FORMAT, '20130614_184135'), | 201 | \DateTime::createFromFormat(\Shaarli\Bookmark\LinkDB::LINK_DATE_FORMAT, '20130614_184135'), |
202 | \DateTime::createFromFormat(\DateTime::ATOM, $data['created']) | 202 | \DateTime::createFromFormat(\DateTime::ATOM, $data['created']) |
203 | ); | 203 | ); |
204 | $this->assertEquals( | 204 | $this->assertEquals( |
205 | \DateTime::createFromFormat(\LinkDB::LINK_DATE_FORMAT, '20130615_184230'), | 205 | \DateTime::createFromFormat(\Shaarli\Bookmark\LinkDB::LINK_DATE_FORMAT, '20130615_184230'), |
206 | \DateTime::createFromFormat(\DateTime::ATOM, $data['updated']) | 206 | \DateTime::createFromFormat(\DateTime::ATOM, $data['updated']) |
207 | ); | 207 | ); |
208 | } | 208 | } |
diff --git a/tests/api/controllers/tags/DeleteTagTest.php b/tests/api/controllers/tags/DeleteTagTest.php index a1e419cd..02803ba2 100644 --- a/tests/api/controllers/tags/DeleteTagTest.php +++ b/tests/api/controllers/tags/DeleteTagTest.php | |||
@@ -32,7 +32,7 @@ class DeleteTagTest extends \PHPUnit_Framework_TestCase | |||
32 | protected $refDB = null; | 32 | protected $refDB = null; |
33 | 33 | ||
34 | /** | 34 | /** |
35 | * @var \LinkDB instance. | 35 | * @var \Shaarli\Bookmark\LinkDB instance. |
36 | */ | 36 | */ |
37 | protected $linkDB; | 37 | protected $linkDB; |
38 | 38 | ||
@@ -59,7 +59,7 @@ class DeleteTagTest extends \PHPUnit_Framework_TestCase | |||
59 | $this->conf = new ConfigManager('tests/utils/config/configJson'); | 59 | $this->conf = new ConfigManager('tests/utils/config/configJson'); |
60 | $this->refDB = new \ReferenceLinkDB(); | 60 | $this->refDB = new \ReferenceLinkDB(); |
61 | $this->refDB->write(self::$testDatastore); | 61 | $this->refDB->write(self::$testDatastore); |
62 | $this->linkDB = new \LinkDB(self::$testDatastore, true, false); | 62 | $this->linkDB = new \Shaarli\Bookmark\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 \Shaarli\History(self::$testHistory); | 65 | $this->history = new \Shaarli\History(self::$testHistory); |
@@ -97,7 +97,7 @@ class DeleteTagTest extends \PHPUnit_Framework_TestCase | |||
97 | $this->assertEquals(204, $response->getStatusCode()); | 97 | $this->assertEquals(204, $response->getStatusCode()); |
98 | $this->assertEmpty((string) $response->getBody()); | 98 | $this->assertEmpty((string) $response->getBody()); |
99 | 99 | ||
100 | $this->linkDB = new \LinkDB(self::$testDatastore, true, false); | 100 | $this->linkDB = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false); |
101 | $tags = $this->linkDB->linksCountPerTag(); | 101 | $tags = $this->linkDB->linksCountPerTag(); |
102 | $this->assertFalse(isset($tags[$tagName])); | 102 | $this->assertFalse(isset($tags[$tagName])); |
103 | 103 | ||
@@ -131,7 +131,7 @@ class DeleteTagTest extends \PHPUnit_Framework_TestCase | |||
131 | $this->assertEquals(204, $response->getStatusCode()); | 131 | $this->assertEquals(204, $response->getStatusCode()); |
132 | $this->assertEmpty((string) $response->getBody()); | 132 | $this->assertEmpty((string) $response->getBody()); |
133 | 133 | ||
134 | $this->linkDB = new \LinkDB(self::$testDatastore, true, false); | 134 | $this->linkDB = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false); |
135 | $tags = $this->linkDB->linksCountPerTag(); | 135 | $tags = $this->linkDB->linksCountPerTag(); |
136 | $this->assertFalse(isset($tags[$tagName])); | 136 | $this->assertFalse(isset($tags[$tagName])); |
137 | $this->assertTrue($tags[strtolower($tagName)] > 0); | 137 | $this->assertTrue($tags[strtolower($tagName)] > 0); |
diff --git a/tests/api/controllers/tags/GetTagNameTest.php b/tests/api/controllers/tags/GetTagNameTest.php index afac228e..8e0feccd 100644 --- a/tests/api/controllers/tags/GetTagNameTest.php +++ b/tests/api/controllers/tags/GetTagNameTest.php | |||
@@ -59,7 +59,7 @@ class GetTagNameTest extends \PHPUnit_Framework_TestCase | |||
59 | 59 | ||
60 | $this->container = new Container(); | 60 | $this->container = new Container(); |
61 | $this->container['conf'] = $this->conf; | 61 | $this->container['conf'] = $this->conf; |
62 | $this->container['db'] = new \LinkDB(self::$testDatastore, true, false); | 62 | $this->container['db'] = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false); |
63 | $this->container['history'] = null; | 63 | $this->container['history'] = null; |
64 | 64 | ||
65 | $this->controller = new Tags($this->container); | 65 | $this->controller = new Tags($this->container); |
diff --git a/tests/api/controllers/tags/GetTagsTest.php b/tests/api/controllers/tags/GetTagsTest.php index 3fab31b0..f071bfa8 100644 --- a/tests/api/controllers/tags/GetTagsTest.php +++ b/tests/api/controllers/tags/GetTagsTest.php | |||
@@ -38,7 +38,7 @@ class GetTagsTest extends \PHPUnit_Framework_TestCase | |||
38 | protected $container; | 38 | protected $container; |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * @var \LinkDB instance. | 41 | * @var \Shaarli\Bookmark\LinkDB instance. |
42 | */ | 42 | */ |
43 | protected $linkDB; | 43 | protected $linkDB; |
44 | 44 | ||
@@ -63,7 +63,7 @@ class GetTagsTest extends \PHPUnit_Framework_TestCase | |||
63 | 63 | ||
64 | $this->container = new Container(); | 64 | $this->container = new Container(); |
65 | $this->container['conf'] = $this->conf; | 65 | $this->container['conf'] = $this->conf; |
66 | $this->linkDB = new \LinkDB(self::$testDatastore, true, false); | 66 | $this->linkDB = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false); |
67 | $this->container['db'] = $this->linkDB; | 67 | $this->container['db'] = $this->linkDB; |
68 | $this->container['history'] = null; | 68 | $this->container['history'] = null; |
69 | 69 | ||
diff --git a/tests/api/controllers/tags/PutTagTest.php b/tests/api/controllers/tags/PutTagTest.php index c45fa722..d8c0fec8 100644 --- a/tests/api/controllers/tags/PutTagTest.php +++ b/tests/api/controllers/tags/PutTagTest.php | |||
@@ -43,7 +43,7 @@ class PutTagTest extends \PHPUnit_Framework_TestCase | |||
43 | protected $container; | 43 | protected $container; |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * @var \LinkDB instance. | 46 | * @var \Shaarli\Bookmark\LinkDB instance. |
47 | */ | 47 | */ |
48 | protected $linkDB; | 48 | protected $linkDB; |
49 | 49 | ||
@@ -72,7 +72,7 @@ class PutTagTest extends \PHPUnit_Framework_TestCase | |||
72 | 72 | ||
73 | $this->container = new Container(); | 73 | $this->container = new Container(); |
74 | $this->container['conf'] = $this->conf; | 74 | $this->container['conf'] = $this->conf; |
75 | $this->linkDB = new \LinkDB(self::$testDatastore, true, false); | 75 | $this->linkDB = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false); |
76 | $this->container['db'] = $this->linkDB; | 76 | $this->container['db'] = $this->linkDB; |
77 | $this->container['history'] = $this->history; | 77 | $this->container['history'] = $this->history; |
78 | 78 | ||