]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/NetscapeBookmarkUtils/BookmarkImportTest.php
Fix: ensure Internet Explorer bookmark dumps can be imported
[github/shaarli/Shaarli.git] / tests / NetscapeBookmarkUtils / BookmarkImportTest.php
index 2d4e755758459be305ac26ef9cb480b141058fd7..f0ad500f09a1879803d11b23bb4ed4a9a6924745 100644 (file)
@@ -82,6 +82,34 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase
         $this->assertEquals(0, count($this->linkDb));
     }
 
+    /**
+     * Ensure IE dumps are supported
+     */
+    public function testImportInternetExplorerEncoding()
+    {
+        $files = file2array('internet_explorer_encoding.htm');
+        $this->assertEquals(
+            'File internet_explorer_encoding.htm (356 bytes) was successfully processed:'
+            .' 1 links imported, 0 links overwritten, 0 links skipped.',
+            NetscapeBookmarkUtils::import(array(), $files, $this->linkDb, $this->pagecache)
+        );
+        $this->assertEquals(1, count($this->linkDb));
+        $this->assertEquals(0, count_private($this->linkDb));
+
+        $this->assertEquals(
+            array(
+                'linkdate' => '20160618_173944',
+                'title' => 'Hg Init a Mercurial tutorial by Joel Spolsky',
+                'url' => 'http://hginit.com/',
+                'description' => '',
+                'private' => 0,
+                'tags' => ''
+            ),
+            $this->linkDb->getLinkFromUrl('http://hginit.com/')
+        );
+    }
+
+
     /**
      * Import bookmarks nested in a folder hierarchy
      */