->disableOriginalConstructor()
->getMock();
+ $config = $this->getMockBuilder('Craue\ConfigBundle\Util\Config')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $config->expects($this->any())
+ ->method('get')
+ ->with('pocket_consumer_key')
+ ->willReturn($consumerKey);
+
$pocket = new PocketImportMock(
$this->tokenStorage,
$this->em,
$this->contentProxy,
- $consumerKey
+ $config
);
$this->logHandler = new TestHandler();
$this->assertEquals('Pocket', $pocketImport->getName());
$this->assertNotEmpty($pocketImport->getUrl());
- $this->assertContains('This importer will import all your <a href="https://getpocket.com">Pocket</a> data.', $pocketImport->getDescription());
+ $this->assertContains('This importer will import all your Pocket data.', $pocketImport->getDescription());
}
public function testOAuthRequest()
->getMock();
$entryRepo->expects($this->exactly(2))
- ->method('existByUrlAndUserId')
+ ->method('findByUrlAndUserId')
->will($this->onConsecutiveCalls(false, true));
$tag = $this->getMockBuilder('Wallabag\CoreBundle\Entity\Tag')
->getMock();
$tagRepo->expects($this->exactly(2))
- ->method('findOneByLabelAndUserId')
+ // the method `findOneByLabel` doesn't exist, EntityRepository will then call `_call` method
+ // to magically call the `findOneBy` with ['label' => 'foo']
+ ->method('__call')
->will($this->onConsecutiveCalls(false, $tag));
$this->em