From f21a5388f925a7b8ec17f5d0229613b0cebff4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 5 Feb 2016 14:39:52 +0100 Subject: add test to check empty fields --- .../Tests/Controller/WallabagV2ControllerTest.php | 12 ++++++++++++ 1 file changed, 12 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 a77c0f6b..49b4703e 100644 --- a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php +++ b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php @@ -41,6 +41,18 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); $this->assertContains('Import summary', $alert[0]); + + $content = $client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findByUrlAndUserId( + 'http://www.liberation.fr/planete/2015/10/26/refugies-l-ue-va-creer-100-000-places-d-accueil-dans-les-balkans_1408867', + $this->getLoggedInUserId() + ); + + $this->assertEquals('', $content->getMimetype()); + $this->assertEquals('', $content->getPreviewPicture()); + $this->assertEquals('', $content->getLanguage()); } public function testImportWallabagWithEmptyFile() -- cgit v1.2.3 From 4c46e2609fe0ebb1f6a4b4b23a3d8647a1d9d9cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 5 Feb 2016 14:52:35 +0100 Subject: an other test for non empty fields --- .../Tests/Controller/WallabagV2ControllerTest.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (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 49b4703e..617c0517 100644 --- a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php +++ b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php @@ -50,9 +50,21 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase $this->getLoggedInUserId() ); - $this->assertEquals('', $content->getMimetype()); - $this->assertEquals('', $content->getPreviewPicture()); - $this->assertEquals('', $content->getLanguage()); + $this->assertEmpty($content->getMimetype()); + $this->assertEmpty($content->getPreviewPicture()); + $this->assertEmpty($content->getLanguage()); + + $content = $client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findByUrlAndUserId( + 'https://www.mediapart.fr/', + $this->getLoggedInUserId() + ); + + $this->assertNotEmpty($content->getMimetype()); + $this->assertNotEmpty($content->getPreviewPicture()); + $this->assertNotEmpty($content->getLanguage()); } public function testImportWallabagWithEmptyFile() -- cgit v1.2.3