+
+ public function testImportCreateUpdateHistory()
+ {
+ $post = [
+ 'privacy' => 'public',
+ 'overwrite' => 'true',
+ ];
+ $files = file2array('netscape_basic.htm');
+ NetscapeBookmarkUtils::import($post, $files, $this->linkDb, $this->conf, $this->history);
+ $history = $this->history->getHistory();
+ $this->assertEquals(1, count($history));
+ $this->assertEquals(History::IMPORT, $history[0]['event']);
+ $this->assertTrue(new DateTime('-5 seconds') < $history[0]['datetime']);
+
+ // re-import as private, enable overwriting
+ NetscapeBookmarkUtils::import($post, $files, $this->linkDb, $this->conf, $this->history);
+ $history = $this->history->getHistory();
+ $this->assertEquals(2, count($history));
+ $this->assertEquals(History::IMPORT, $history[0]['event']);
+ $this->assertTrue(new DateTime('-5 seconds') < $history[0]['datetime']);
+ $this->assertEquals(History::IMPORT, $history[1]['event']);
+ $this->assertTrue(new DateTime('-5 seconds') < $history[1]['datetime']);
+ }