aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-02-11 15:48:20 +0100
committerThomas Citharel <tcit@tcit.fr>2016-02-11 15:48:20 +0100
commiteaf9dad777e84d50e8b3e5877b05605ad9138fee (patch)
tree69b41409e9d39d7718fc9c8fb8409ab599387be1 /src/Wallabag/ImportBundle/Import/WallabagV1Import.php
parentda0a9e01e9b6ef52656aa47367bfc30b1905fe40 (diff)
downloadwallabag-eaf9dad777e84d50e8b3e5877b05605ad9138fee.tar.gz
wallabag-eaf9dad777e84d50e8b3e5877b05605ad9138fee.tar.zst
wallabag-eaf9dad777e84d50e8b3e5877b05605ad9138fee.zip
add tests
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/WallabagV1Import.php')
-rw-r--r--src/Wallabag/ImportBundle/Import/WallabagV1Import.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
index 02327312..c54e73b2 100644
--- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
+++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
@@ -15,7 +15,7 @@ class WallabagV1Import implements ImportInterface
15 protected $user; 15 protected $user;
16 protected $em; 16 protected $em;
17 protected $logger; 17 protected $logger;
18 private $contentProxy; 18 protected $contentProxy;
19 protected $skippedEntries = 0; 19 protected $skippedEntries = 0;
20 protected $importedEntries = 0; 20 protected $importedEntries = 0;
21 protected $filepath; 21 protected $filepath;
@@ -126,10 +126,9 @@ class WallabagV1Import implements ImportInterface
126 protected function parseEntries($entries) 126 protected function parseEntries($entries)
127 { 127 {
128 $i = 1; 128 $i = 1;
129 /* 129
130 * Untitled in all languages from v1. This should never have been translated 130 //Untitled in all languages from v1. This should never have been translated
131 */ 131 $untitled = array('Untitled', 'Sans titre', 'podle nadpisu', 'Sin título', 'با عنوان', 'per titolo', 'Sem título', 'Без названия', 'po naslovu', 'Без назви', 'No title found', '');
132 $untitled = array('Untitled', 'Sans titre', 'podle nadpisu', 'Sin título', 'با عنوان', 'per titolo', 'Sem título', 'Без названия', 'po naslovu', 'Без назви');
133 132
134 foreach ($entries as $importedEntry) { 133 foreach ($entries as $importedEntry) {
135 $existingEntry = $this->em 134 $existingEntry = $this->em
@@ -145,7 +144,7 @@ class WallabagV1Import implements ImportInterface
145 $entry = new Entry($this->user); 144 $entry = new Entry($this->user);
146 $entry->setUrl($importedEntry['url']); 145 $entry->setUrl($importedEntry['url']);
147 if (in_array($importedEntry['title'], $untitled)) { 146 if (in_array($importedEntry['title'], $untitled)) {
148 $entry = $this->contentProxy->updateEntry($entry, $entry->getUrl()); 147 $entry = $this->contentProxy->updateEntry($entry, $importedEntry['url']);
149 } else { 148 } else {
150 $entry->setContent($importedEntry['content']); 149 $entry->setContent($importedEntry['content']);
151 $entry->setTitle($importedEntry['title']); 150 $entry->setTitle($importedEntry['title']);