X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FTests%2FImport%2FWallabagV1ImportTest.php;h=78cc19b6bcbc7fc542617448050277fdee7a839f;hb=0783c99a196d1626d91119f715285150662fbe6e;hp=d5b41777caf041f0f6b46b5571bf2f2eb21fd1e9;hpb=39643c6b76d92d509b1af0228b6379d7fdce8a1c;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php index d5b41777..78cc19b6 100644 --- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php +++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php @@ -12,6 +12,8 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase protected $user; protected $em; protected $logHandler; + protected $contentProxy; + private function getWallabagV1Import($unsetUser = false) { @@ -21,17 +23,21 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $pocket = new WallabagV1Import($this->em); + $this->contentProxy = $this->getMockBuilder('Wallabag\CoreBundle\Helper\ContentProxy') + ->disableOriginalConstructor() + ->getMock(); + + $wallabag = new WallabagV1Import($this->em,$this->contentProxy); $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() @@ -53,7 +59,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase ->getMock(); $entryRepo->expects($this->exactly(3)) - ->method('existByUrlAndUserId') + ->method('findByUrlAndUserId') ->will($this->onConsecutiveCalls(false, true, false)); $this->em @@ -77,7 +83,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 +97,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']); } }