diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-11-28 18:24:15 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-12-12 03:03:12 +0100 |
commit | d592daea8343bb4dfecff5d97e93699581ccc58c (patch) | |
tree | d508b902b3aba45795fafe16e0b921ac5ea7c4c4 /tests/NetscapeBookmarkUtils | |
parent | c3dfd8995921083ff7250c25d0b6ab1184b91aff (diff) | |
download | Shaarli-d592daea8343bb4dfecff5d97e93699581ccc58c.tar.gz Shaarli-d592daea8343bb4dfecff5d97e93699581ccc58c.tar.zst Shaarli-d592daea8343bb4dfecff5d97e93699581ccc58c.zip |
Add a persistent 'shorturl' key to all links
All existing link will keep their permalinks.
New links will have smallhash generated with date+id.
The purpose of this is to avoid collision between links due to their creation date.
Diffstat (limited to 'tests/NetscapeBookmarkUtils')
-rw-r--r-- | tests/NetscapeBookmarkUtils/BookmarkImportTest.php | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/NetscapeBookmarkUtils/BookmarkImportTest.php b/tests/NetscapeBookmarkUtils/BookmarkImportTest.php index 96895b00..0ca07eac 100644 --- a/tests/NetscapeBookmarkUtils/BookmarkImportTest.php +++ b/tests/NetscapeBookmarkUtils/BookmarkImportTest.php | |||
@@ -116,7 +116,7 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase | |||
116 | $this->assertEquals( | 116 | $this->assertEquals( |
117 | array( | 117 | array( |
118 | 'id' => 0, | 118 | 'id' => 0, |
119 | 'created' => DateTime::createFromFormat('Ymd_His', '20160618_203944'), | 119 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20160618_203944'), |
120 | 'title' => 'Hg Init a Mercurial tutorial by Joel Spolsky', | 120 | 'title' => 'Hg Init a Mercurial tutorial by Joel Spolsky', |
121 | 'url' => 'http://hginit.com/', | 121 | 'url' => 'http://hginit.com/', |
122 | 'description' => '', | 122 | 'description' => '', |
@@ -145,7 +145,7 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase | |||
145 | $this->assertEquals( | 145 | $this->assertEquals( |
146 | array( | 146 | array( |
147 | 'id' => 0, | 147 | 'id' => 0, |
148 | 'created' => DateTime::createFromFormat('Ymd_His', '20160225_235541'), | 148 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20160225_235541'), |
149 | 'title' => 'Nested 1', | 149 | 'title' => 'Nested 1', |
150 | 'url' => 'http://nest.ed/1', | 150 | 'url' => 'http://nest.ed/1', |
151 | 'description' => '', | 151 | 'description' => '', |
@@ -158,7 +158,7 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase | |||
158 | $this->assertEquals( | 158 | $this->assertEquals( |
159 | array( | 159 | array( |
160 | 'id' => 1, | 160 | 'id' => 1, |
161 | 'created' => DateTime::createFromFormat('Ymd_His', '20160225_235542'), | 161 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20160225_235542'), |
162 | 'title' => 'Nested 1-1', | 162 | 'title' => 'Nested 1-1', |
163 | 'url' => 'http://nest.ed/1-1', | 163 | 'url' => 'http://nest.ed/1-1', |
164 | 'description' => '', | 164 | 'description' => '', |
@@ -171,7 +171,7 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase | |||
171 | $this->assertEquals( | 171 | $this->assertEquals( |
172 | array( | 172 | array( |
173 | 'id' => 2, | 173 | 'id' => 2, |
174 | 'created' => DateTime::createFromFormat('Ymd_His', '20160225_235547'), | 174 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20160225_235547'), |
175 | 'title' => 'Nested 1-2', | 175 | 'title' => 'Nested 1-2', |
176 | 'url' => 'http://nest.ed/1-2', | 176 | 'url' => 'http://nest.ed/1-2', |
177 | 'description' => '', | 177 | 'description' => '', |
@@ -184,7 +184,7 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase | |||
184 | $this->assertEquals( | 184 | $this->assertEquals( |
185 | array( | 185 | array( |
186 | 'id' => 3, | 186 | 'id' => 3, |
187 | 'created' => DateTime::createFromFormat('Ymd_His', '20160202_202222'), | 187 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20160202_202222'), |
188 | 'title' => 'Nested 2-1', | 188 | 'title' => 'Nested 2-1', |
189 | 'url' => 'http://nest.ed/2-1', | 189 | 'url' => 'http://nest.ed/2-1', |
190 | 'description' => 'First link of the second section', | 190 | 'description' => 'First link of the second section', |
@@ -197,7 +197,7 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase | |||
197 | $this->assertEquals( | 197 | $this->assertEquals( |
198 | array( | 198 | array( |
199 | 'id' => 4, | 199 | 'id' => 4, |
200 | 'created' => DateTime::createFromFormat('Ymd_His', '20160119_230227'), | 200 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20160119_230227'), |
201 | 'title' => 'Nested 2-2', | 201 | 'title' => 'Nested 2-2', |
202 | 'url' => 'http://nest.ed/2-2', | 202 | 'url' => 'http://nest.ed/2-2', |
203 | 'description' => 'Second link of the second section', | 203 | 'description' => 'Second link of the second section', |
@@ -210,7 +210,7 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase | |||
210 | $this->assertEquals( | 210 | $this->assertEquals( |
211 | array( | 211 | array( |
212 | 'id' => 5, | 212 | 'id' => 5, |
213 | 'created' => DateTime::createFromFormat('Ymd_His', '20160202_202222'), | 213 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20160202_202222'), |
214 | 'title' => 'Nested 3-1', | 214 | 'title' => 'Nested 3-1', |
215 | 'url' => 'http://nest.ed/3-1', | 215 | 'url' => 'http://nest.ed/3-1', |
216 | 'description' => '', | 216 | 'description' => '', |
@@ -223,7 +223,7 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase | |||
223 | $this->assertEquals( | 223 | $this->assertEquals( |
224 | array( | 224 | array( |
225 | 'id' => 6, | 225 | 'id' => 6, |
226 | 'created' => DateTime::createFromFormat('Ymd_His', '20160119_230227'), | 226 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20160119_230227'), |
227 | 'title' => 'Nested 3-2', | 227 | 'title' => 'Nested 3-2', |
228 | 'url' => 'http://nest.ed/3-2', | 228 | 'url' => 'http://nest.ed/3-2', |
229 | 'description' => '', | 229 | 'description' => '', |
@@ -236,7 +236,7 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase | |||
236 | $this->assertEquals( | 236 | $this->assertEquals( |
237 | array( | 237 | array( |
238 | 'id' => 7, | 238 | 'id' => 7, |
239 | 'created' => DateTime::createFromFormat('Ymd_His', '20160229_111541'), | 239 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20160229_111541'), |
240 | 'title' => 'Nested 2', | 240 | 'title' => 'Nested 2', |
241 | 'url' => 'http://nest.ed/2', | 241 | 'url' => 'http://nest.ed/2', |
242 | 'description' => '', | 242 | 'description' => '', |
@@ -269,7 +269,7 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase | |||
269 | array( | 269 | array( |
270 | 'id' => 0, | 270 | 'id' => 0, |
271 | // Old link - UTC+4 (note that TZ in the import file is ignored). | 271 | // Old link - UTC+4 (note that TZ in the import file is ignored). |
272 | 'created' => DateTime::createFromFormat('Ymd_His', '20001010_135536'), | 272 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20001010_135536'), |
273 | 'title' => 'Secret stuff', | 273 | 'title' => 'Secret stuff', |
274 | 'url' => 'https://private.tld', | 274 | 'url' => 'https://private.tld', |
275 | 'description' => "Super-secret stuff you're not supposed to know about", | 275 | 'description' => "Super-secret stuff you're not supposed to know about", |
@@ -282,7 +282,7 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase | |||
282 | $this->assertEquals( | 282 | $this->assertEquals( |
283 | array( | 283 | array( |
284 | 'id' => 1, | 284 | 'id' => 1, |
285 | 'created' => DateTime::createFromFormat('Ymd_His', '20160225_235548'), | 285 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20160225_235548'), |
286 | 'title' => 'Public stuff', | 286 | 'title' => 'Public stuff', |
287 | 'url' => 'http://public.tld', | 287 | 'url' => 'http://public.tld', |
288 | 'description' => '', | 288 | 'description' => '', |
@@ -313,7 +313,7 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase | |||
313 | array( | 313 | array( |
314 | 'id' => 0, | 314 | 'id' => 0, |
315 | // Note that TZ in the import file is ignored. | 315 | // Note that TZ in the import file is ignored. |
316 | 'created' => DateTime::createFromFormat('Ymd_His', '20001010_135536'), | 316 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20001010_135536'), |
317 | 'title' => 'Secret stuff', | 317 | 'title' => 'Secret stuff', |
318 | 'url' => 'https://private.tld', | 318 | 'url' => 'https://private.tld', |
319 | 'description' => "Super-secret stuff you're not supposed to know about", | 319 | 'description' => "Super-secret stuff you're not supposed to know about", |
@@ -326,7 +326,7 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase | |||
326 | $this->assertEquals( | 326 | $this->assertEquals( |
327 | array( | 327 | array( |
328 | 'id' => 1, | 328 | 'id' => 1, |
329 | 'created' => DateTime::createFromFormat('Ymd_His', '20160225_235548'), | 329 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20160225_235548'), |
330 | 'title' => 'Public stuff', | 330 | 'title' => 'Public stuff', |
331 | 'url' => 'http://public.tld', | 331 | 'url' => 'http://public.tld', |
332 | 'description' => '', | 332 | 'description' => '', |