From 4d0ec0e72108ff47952906e5d968a7c3eb0a76f9 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 27 Mar 2016 20:35:56 +0200 Subject: Fix some Scrutinizer issues --- .../Tests/Controller/PocketControllerTest.php | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/Wallabag/ImportBundle/Tests/Controller/PocketControllerTest.php') diff --git a/src/Wallabag/ImportBundle/Tests/Controller/PocketControllerTest.php b/src/Wallabag/ImportBundle/Tests/Controller/PocketControllerTest.php index 174641fd..403fe9b0 100644 --- a/src/Wallabag/ImportBundle/Tests/Controller/PocketControllerTest.php +++ b/src/Wallabag/ImportBundle/Tests/Controller/PocketControllerTest.php @@ -17,11 +17,34 @@ class PocketControllerTest extends WallabagCoreTestCase $this->assertEquals(1, $crawler->filter('button[type=submit]')->count()); } + public function testImportPocketAuthBadToken() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/import/pocket/auth'); + + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + } + public function testImportPocketAuth() { + $this->markTestSkipped('PocketImport: Find a way to properly mock a service.'); + $this->logInAs('admin'); $client = $this->getClient(); + $pocketImport = $this->getMockBuilder('Wallabag\ImportBundle\Import\PocketImport') + ->disableOriginalConstructor() + ->getMock(); + + $pocketImport + ->expects($this->once()) + ->method('getRequestToken') + ->willReturn('token'); + + $client->getContainer()->set('wallabag_import.pocket.import', $pocketImport); + $crawler = $client->request('GET', '/import/pocket/auth'); $this->assertEquals(301, $client->getResponse()->getStatusCode()); -- cgit v1.2.3