mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-15 21:41:06 +00:00
CS
This commit is contained in:
parent
0783c99a19
commit
da0a9e01e9
3 changed files with 5 additions and 7 deletions
|
@ -10,7 +10,6 @@ use Wallabag\UserBundle\Entity\User;
|
|||
use Wallabag\CoreBundle\Tools\Utils;
|
||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
||||
|
||||
|
||||
class WallabagV1Import implements ImportInterface
|
||||
{
|
||||
protected $user;
|
||||
|
@ -127,10 +126,10 @@ class WallabagV1Import implements ImportInterface
|
|||
protected function parseEntries($entries)
|
||||
{
|
||||
$i = 1;
|
||||
/**
|
||||
/*
|
||||
* Untitled in all languages from v1. This should never have been translated
|
||||
*/
|
||||
$untitled = array('Untitled','Sans titre','podle nadpisu','Sin título','با عنوان','per titolo','Sem título','Без названия','po naslovu','Без назви');
|
||||
$untitled = array('Untitled', 'Sans titre', 'podle nadpisu', 'Sin título', 'با عنوان', 'per titolo', 'Sem título', 'Без названия', 'po naslovu', 'Без назви');
|
||||
|
||||
foreach ($entries as $importedEntry) {
|
||||
$existingEntry = $this->em
|
||||
|
@ -145,7 +144,7 @@ class WallabagV1Import implements ImportInterface
|
|||
// @see ContentProxy->updateEntry
|
||||
$entry = new Entry($this->user);
|
||||
$entry->setUrl($importedEntry['url']);
|
||||
if (in_array($importedEntry['title'],$untitled)) {
|
||||
if (in_array($importedEntry['title'], $untitled)) {
|
||||
$entry = $this->contentProxy->updateEntry($entry, $entry->getUrl());
|
||||
} else {
|
||||
$entry->setContent($importedEntry['content']);
|
||||
|
|
|
@ -14,7 +14,6 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase
|
|||
protected $logHandler;
|
||||
protected $contentProxy;
|
||||
|
||||
|
||||
private function getWallabagV1Import($unsetUser = false)
|
||||
{
|
||||
$this->user = new User();
|
||||
|
@ -27,7 +26,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$wallabag = new WallabagV1Import($this->em,$this->contentProxy);
|
||||
$wallabag = new WallabagV1Import($this->em, $this->contentProxy);
|
||||
|
||||
$this->logHandler = new TestHandler();
|
||||
$logger = new Logger('test', array($this->logHandler));
|
||||
|
|
|
@ -26,7 +26,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$wallabag = new WallabagV2Import($this->em,$this->contentProxy);
|
||||
$wallabag = new WallabagV2Import($this->em, $this->contentProxy);
|
||||
|
||||
$this->logHandler = new TestHandler();
|
||||
$logger = new Logger('test', array($this->logHandler));
|
||||
|
|
Loading…
Reference in a new issue