X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FImportBundle%2FImport%2FPocketImportTest.php;h=952521a2a90759b19e461b19adc01ba758cdda7c;hb=da18a4682f124b02278860d23ac1d59dee995277;hp=a3f68892f40b7420356939a0ab3e0d453a66aedf;hpb=c80cc01afa315dcfa38b2a01c5b05d4516659c24;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php index a3f68892..952521a2 100644 --- a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php +++ b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php @@ -4,6 +4,7 @@ namespace Tests\Wallabag\ImportBundle\Import; use Wallabag\UserBundle\Entity\User; use Wallabag\CoreBundle\Entity\Entry; +use Wallabag\CoreBundle\Entity\Config; use Wallabag\ImportBundle\Import\PocketImport; use GuzzleHttp\Client; use GuzzleHttp\Subscriber\Mock; @@ -27,6 +28,11 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase { $this->user = new User(); + $config = new Config($this->user); + $config->setPocketConsumerKey('xxx'); + + $this->user->setConfig($config); + $this->contentProxy = $this->getMockBuilder('Wallabag\CoreBundle\Helper\ContentProxy') ->disableOriginalConstructor() ->getMock(); @@ -35,19 +41,9 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase ->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 PocketImport( $this->em, - $this->contentProxy, - $config + $this->contentProxy ); $pocket->setUser($this->user); @@ -570,6 +566,8 @@ JSON; "status": 1, "list": { "229279689": { + "status": "1", + "favorite": "1", "resolved_url": "http://www.grantland.com/blog/the-triangle/post/_/id/38347/ryder-cup-preview" } } @@ -607,6 +605,6 @@ JSON; $res = $pocketImport->import(); $this->assertTrue($res); - $this->assertEquals(['skipped' => 1, 'imported' => 0, 'queued' => 0], $pocketImport->getSummary()); + $this->assertEquals(['skipped' => 0, 'imported' => 1, 'queued' => 0], $pocketImport->getSummary()); } }