aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/Wallabag/ImportBundle/Import/WallabagV1Import.php7
-rw-r--r--src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php3
-rw-r--r--src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php2
3 files changed, 5 insertions, 7 deletions
diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
index 82b52ad3..02327312 100644
--- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
+++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
@@ -10,7 +10,6 @@ use Wallabag\UserBundle\Entity\User;
10use Wallabag\CoreBundle\Tools\Utils; 10use Wallabag\CoreBundle\Tools\Utils;
11use Wallabag\CoreBundle\Helper\ContentProxy; 11use Wallabag\CoreBundle\Helper\ContentProxy;
12 12
13
14class WallabagV1Import implements ImportInterface 13class WallabagV1Import implements ImportInterface
15{ 14{
16 protected $user; 15 protected $user;
@@ -127,10 +126,10 @@ class WallabagV1Import implements ImportInterface
127 protected function parseEntries($entries) 126 protected function parseEntries($entries)
128 { 127 {
129 $i = 1; 128 $i = 1;
130 /** 129 /*
131 * 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
132 */ 131 */
133 $untitled = array('Untitled','Sans titre','podle nadpisu','Sin título','با عنوان','per titolo','Sem título','Без названия','po naslovu','Без назви'); 132 $untitled = array('Untitled', 'Sans titre', 'podle nadpisu', 'Sin título', 'با عنوان', 'per titolo', 'Sem título', 'Без названия', 'po naslovu', 'Без назви');
134 133
135 foreach ($entries as $importedEntry) { 134 foreach ($entries as $importedEntry) {
136 $existingEntry = $this->em 135 $existingEntry = $this->em
@@ -145,7 +144,7 @@ class WallabagV1Import implements ImportInterface
145 // @see ContentProxy->updateEntry 144 // @see ContentProxy->updateEntry
146 $entry = new Entry($this->user); 145 $entry = new Entry($this->user);
147 $entry->setUrl($importedEntry['url']); 146 $entry->setUrl($importedEntry['url']);
148 if (in_array($importedEntry['title'],$untitled)) { 147 if (in_array($importedEntry['title'], $untitled)) {
149 $entry = $this->contentProxy->updateEntry($entry, $entry->getUrl()); 148 $entry = $this->contentProxy->updateEntry($entry, $entry->getUrl());
150 } else { 149 } else {
151 $entry->setContent($importedEntry['content']); 150 $entry->setContent($importedEntry['content']);
diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php
index 78cc19b6..093420f9 100644
--- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php
+++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php
@@ -14,7 +14,6 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase
14 protected $logHandler; 14 protected $logHandler;
15 protected $contentProxy; 15 protected $contentProxy;
16 16
17
18 private function getWallabagV1Import($unsetUser = false) 17 private function getWallabagV1Import($unsetUser = false)
19 { 18 {
20 $this->user = new User(); 19 $this->user = new User();
@@ -27,7 +26,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase
27 ->disableOriginalConstructor() 26 ->disableOriginalConstructor()
28 ->getMock(); 27 ->getMock();
29 28
30 $wallabag = new WallabagV1Import($this->em,$this->contentProxy); 29 $wallabag = new WallabagV1Import($this->em, $this->contentProxy);
31 30
32 $this->logHandler = new TestHandler(); 31 $this->logHandler = new TestHandler();
33 $logger = new Logger('test', array($this->logHandler)); 32 $logger = new Logger('test', array($this->logHandler));
diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
index 0b33afb6..ebabb8f7 100644
--- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
+++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
@@ -26,7 +26,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
26 ->disableOriginalConstructor() 26 ->disableOriginalConstructor()
27 ->getMock(); 27 ->getMock();
28 28
29 $wallabag = new WallabagV2Import($this->em,$this->contentProxy); 29 $wallabag = new WallabagV2Import($this->em, $this->contentProxy);
30 30
31 $this->logHandler = new TestHandler(); 31 $this->logHandler = new TestHandler();
32 $logger = new Logger('test', array($this->logHandler)); 32 $logger = new Logger('test', array($this->logHandler));