aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/NetscapeBookmarkUtils
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2019-07-27 12:34:30 +0200
committerArthurHoaro <arthur@hoa.ro>2019-07-27 12:34:30 +0200
commit38672ba0d1c722e5d6d33a58255ceb55e9410e46 (patch)
treedae4c7c47532380eac3ae641db99122fc77c93dc /tests/NetscapeBookmarkUtils
parent83faedadff76c5bdca036f39f13943f63b27e164 (diff)
parent1e77e0448bbd25675d8c0fe4a73206ad9048904b (diff)
downloadShaarli-38672ba0d1c722e5d6d33a58255ceb55e9410e46.tar.gz
Shaarli-38672ba0d1c722e5d6d33a58255ceb55e9410e46.tar.zst
Shaarli-38672ba0d1c722e5d6d33a58255ceb55e9410e46.zip
Merge tag 'v0.10.4' into stable
Release v0.10.4
Diffstat (limited to 'tests/NetscapeBookmarkUtils')
-rw-r--r--tests/NetscapeBookmarkUtils/BookmarkExportTest.php4
-rw-r--r--tests/NetscapeBookmarkUtils/BookmarkImportTest.php15
-rw-r--r--tests/NetscapeBookmarkUtils/input/lowercase_doctype.htm8
3 files changed, 25 insertions, 2 deletions
diff --git a/tests/NetscapeBookmarkUtils/BookmarkExportTest.php b/tests/NetscapeBookmarkUtils/BookmarkExportTest.php
index 6a47bbb9..77fbd5f3 100644
--- a/tests/NetscapeBookmarkUtils/BookmarkExportTest.php
+++ b/tests/NetscapeBookmarkUtils/BookmarkExportTest.php
@@ -110,7 +110,7 @@ class BookmarkExportTest extends PHPUnit_Framework_TestCase
110 $links = NetscapeBookmarkUtils::filterAndFormat(self::$linkDb, 'public', false, ''); 110 $links = NetscapeBookmarkUtils::filterAndFormat(self::$linkDb, 'public', false, '');
111 $this->assertEquals( 111 $this->assertEquals(
112 '?WDWyig', 112 '?WDWyig',
113 $links[0]['url'] 113 $links[2]['url']
114 ); 114 );
115 } 115 }
116 116
@@ -128,7 +128,7 @@ class BookmarkExportTest extends PHPUnit_Framework_TestCase
128 ); 128 );
129 $this->assertEquals( 129 $this->assertEquals(
130 $indexUrl . '?WDWyig', 130 $indexUrl . '?WDWyig',
131 $links[0]['url'] 131 $links[2]['url']
132 ); 132 );
133 } 133 }
134} 134}
diff --git a/tests/NetscapeBookmarkUtils/BookmarkImportTest.php b/tests/NetscapeBookmarkUtils/BookmarkImportTest.php
index 4961aa2c..f0a958cb 100644
--- a/tests/NetscapeBookmarkUtils/BookmarkImportTest.php
+++ b/tests/NetscapeBookmarkUtils/BookmarkImportTest.php
@@ -127,6 +127,21 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase
127 } 127 }
128 128
129 /** 129 /**
130 * Attempt to import bookmarks from a file with a lowercase Doctype
131 */
132 public function testImportLowecaseDoctype()
133 {
134 $files = file2array('lowercase_doctype.htm');
135 $this->assertStringMatchesFormat(
136 'File lowercase_doctype.htm (386 bytes) was successfully processed in %d seconds:'
137 .' 2 links imported, 0 links overwritten, 0 links skipped.',
138 NetscapeBookmarkUtils::import(null, $files, $this->linkDb, $this->conf, $this->history)
139 );
140 $this->assertEquals(2, count($this->linkDb));
141 }
142
143
144 /**
130 * Ensure IE dumps are supported 145 * Ensure IE dumps are supported
131 */ 146 */
132 public function testImportInternetExplorerEncoding() 147 public function testImportInternetExplorerEncoding()
diff --git a/tests/NetscapeBookmarkUtils/input/lowercase_doctype.htm b/tests/NetscapeBookmarkUtils/input/lowercase_doctype.htm
new file mode 100644
index 00000000..8911ad19
--- /dev/null
+++ b/tests/NetscapeBookmarkUtils/input/lowercase_doctype.htm
@@ -0,0 +1,8 @@
1<!DOCTYPE netscape-bookmark-file-1>
2<TITLE>Bookmarks</TITLE>
3<H1>Bookmarks</H1>
4<DL><p>
5<DT><A HREF="https://private.tld" ADD_DATE="10/Oct/2000:13:55:36 +0300" PRIVATE="1" TAGS="private secret">Secret stuff</A>
6<DD>Super-secret stuff you're not supposed to know about
7<DT><A HREF="http://public.tld" ADD_DATE="1456433748" PRIVATE="0" TAGS="public hello world">Public stuff</A>
8</DL><p>