mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +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\Tools\Utils;
|
||||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
use Wallabag\CoreBundle\Helper\ContentProxy;
|
||||||
|
|
||||||
|
|
||||||
class WallabagV1Import implements ImportInterface
|
class WallabagV1Import implements ImportInterface
|
||||||
{
|
{
|
||||||
protected $user;
|
protected $user;
|
||||||
|
@ -127,10 +126,10 @@ class WallabagV1Import implements ImportInterface
|
||||||
protected function parseEntries($entries)
|
protected function parseEntries($entries)
|
||||||
{
|
{
|
||||||
$i = 1;
|
$i = 1;
|
||||||
/**
|
/*
|
||||||
* Untitled in all languages from v1. This should never have been translated
|
* 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) {
|
foreach ($entries as $importedEntry) {
|
||||||
$existingEntry = $this->em
|
$existingEntry = $this->em
|
||||||
|
@ -145,7 +144,7 @@ class WallabagV1Import implements ImportInterface
|
||||||
// @see ContentProxy->updateEntry
|
// @see ContentProxy->updateEntry
|
||||||
$entry = new Entry($this->user);
|
$entry = new Entry($this->user);
|
||||||
$entry->setUrl($importedEntry['url']);
|
$entry->setUrl($importedEntry['url']);
|
||||||
if (in_array($importedEntry['title'],$untitled)) {
|
if (in_array($importedEntry['title'], $untitled)) {
|
||||||
$entry = $this->contentProxy->updateEntry($entry, $entry->getUrl());
|
$entry = $this->contentProxy->updateEntry($entry, $entry->getUrl());
|
||||||
} else {
|
} else {
|
||||||
$entry->setContent($importedEntry['content']);
|
$entry->setContent($importedEntry['content']);
|
||||||
|
|
|
@ -14,7 +14,6 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase
|
||||||
protected $logHandler;
|
protected $logHandler;
|
||||||
protected $contentProxy;
|
protected $contentProxy;
|
||||||
|
|
||||||
|
|
||||||
private function getWallabagV1Import($unsetUser = false)
|
private function getWallabagV1Import($unsetUser = false)
|
||||||
{
|
{
|
||||||
$this->user = new User();
|
$this->user = new User();
|
||||||
|
@ -27,7 +26,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$wallabag = new WallabagV1Import($this->em,$this->contentProxy);
|
$wallabag = new WallabagV1Import($this->em, $this->contentProxy);
|
||||||
|
|
||||||
$this->logHandler = new TestHandler();
|
$this->logHandler = new TestHandler();
|
||||||
$logger = new Logger('test', array($this->logHandler));
|
$logger = new Logger('test', array($this->logHandler));
|
||||||
|
|
|
@ -26,7 +26,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$wallabag = new WallabagV2Import($this->em,$this->contentProxy);
|
$wallabag = new WallabagV2Import($this->em, $this->contentProxy);
|
||||||
|
|
||||||
$this->logHandler = new TestHandler();
|
$this->logHandler = new TestHandler();
|
||||||
$logger = new Logger('test', array($this->logHandler));
|
$logger = new Logger('test', array($this->logHandler));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue