[#1590] Add JSON import from wallabag v2

This commit is contained in:
Nicolas Lœuillet
2016-01-20 14:37:01 +01:00
parent d481f42b7d
commit 6785f4aa74
12 changed files with 344 additions and 20 deletions

View File

@ -21,17 +21,17 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor()
->getMock();
$pocket = new WallabagV1Import($this->em);
$wallabag = new WallabagV1Import($this->em);
$this->logHandler = new TestHandler();
$logger = new Logger('test', array($this->logHandler));
$pocket->setLogger($logger);
$wallabag->setLogger($logger);
if (false === $unsetUser) {
$pocket->setUser($this->user);
$wallabag->setUser($this->user);
}
return $pocket;
return $wallabag;
}
public function testInit()
@ -77,7 +77,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('WallabagV1Import: unable to read file', $records[0]['message']);
$this->assertContains('WallabagImport: unable to read file', $records[0]['message']);
$this->assertEquals('ERROR', $records[0]['level_name']);
}
@ -91,7 +91,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('WallabagV1Import: user is not defined', $records[0]['message']);
$this->assertContains('WallabagImport: user is not defined', $records[0]['message']);
$this->assertEquals('ERROR', $records[0]['level_name']);
}
}