]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php
Convert english translation file
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Tests / Controller / WallabagV2ControllerTest.php
index a77c0f6b901ce3aea853927d719f9a3f08c2e943..58baa8360cb3af0af413c0f2cdc4a5fc6415af46 100644 (file)
@@ -39,8 +39,32 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
 
         $crawler = $client->followRedirect();
 
-        $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
-        $this->assertContains('Import summary', $alert[0]);
+        $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
+        $this->assertContains('Import summary', $body[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->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()
@@ -63,7 +87,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
 
         $crawler = $client->followRedirect();
 
-        $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
-        $this->assertContains('Import failed, please try again', $alert[0]);
+        $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
+        $this->assertContains('Import failed, please try again', $body[0]);
     }
 }