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') 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 From 8f336fda649c064cabfa692793334067ece780f9 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 27 Mar 2016 23:32:55 +0200 Subject: Tags were not imported in wallabag v2 import Also, simplify exportAs matching format --- src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Wallabag/ImportBundle/Tests/Controller') diff --git a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php index bcbd6305..490f9ede 100644 --- a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php +++ b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php @@ -53,6 +53,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase $this->assertEmpty($content->getMimetype()); $this->assertEmpty($content->getPreviewPicture()); $this->assertEmpty($content->getLanguage()); + $this->assertEquals(0, count($content->getTags())); $content = $client->getContainer() ->get('doctrine.orm.entity_manager') @@ -65,6 +66,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase $this->assertNotEmpty($content->getMimetype()); $this->assertNotEmpty($content->getPreviewPicture()); $this->assertNotEmpty($content->getLanguage()); + $this->assertEquals(2, count($content->getTags())); } public function testImportWallabagWithEmptyFile() -- cgit v1.2.3