+ /**
+ * Attempt to import bookmarks from a file with a lowercase Doctype
+ */
+ public function testImportLowecaseDoctype()
+ {
+ $files = file2array('lowercase_doctype.htm');
+ $this->assertStringMatchesFormat(
+ 'File lowercase_doctype.htm (386 bytes) was successfully processed in %d seconds:'
+ .' 2 links imported, 0 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import(null, $files, $this->linkDb, $this->conf, $this->history)
+ );
+ $this->assertEquals(2, count($this->linkDb));
+ }
+
+
+ /**
+ * Ensure IE dumps are supported
+ */
+ public function testImportInternetExplorerEncoding()
+ {
+ $files = file2array('internet_explorer_encoding.htm');
+ $this->assertStringMatchesFormat(
+ 'File internet_explorer_encoding.htm (356 bytes) was successfully processed in %d seconds:'
+ .' 1 links imported, 0 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import([], $files, $this->linkDb, $this->conf, $this->history)
+ );
+ $this->assertEquals(1, count($this->linkDb));
+ $this->assertEquals(0, count_private($this->linkDb));
+
+ $this->assertEquals(
+ array(
+ 'id' => 0,
+ 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20160618_203944'),
+ 'title' => 'Hg Init a Mercurial tutorial by Joel Spolsky',
+ 'url' => 'http://hginit.com/',
+ 'description' => '',
+ 'private' => 0,
+ 'tags' => '',
+ 'shorturl' => 'La37cg',
+ ),
+ $this->linkDb->getLinkFromUrl('http://hginit.com/')
+ );
+ }
+