+
+ public function testImportPocketCallback()
+ {
+ $this->logInAs('admin');
+ $client = $this->getClient();
+
+ $pocketImport = $this->getMockBuilder('Wallabag\ImportBundle\Import\PocketImport')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $pocketImport
+ ->expects($this->once())
+ ->method('authorize')
+ ->willReturn(true);
+
+ $pocketImport
+ ->expects($this->once())
+ ->method('setMarkAsRead')
+ ->with(false)
+ ->willReturn($pocketImport);
+
+ $pocketImport
+ ->expects($this->once())
+ ->method('import')
+ ->willReturn(true);
+
+ static::$kernel->getContainer()->set('wallabag_import.pocket.import', $pocketImport);
+
+ $client->request('GET', '/import/pocket/callback');
+
+ $this->assertEquals(302, $client->getResponse()->getStatusCode());
+ $this->assertContains('/', $client->getResponse()->headers->get('location'), 'Import is ok, redirect to homepage');
+ $this->assertEquals('flashes.import.notice.summary', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]);
+ }