]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php
Added test for export by filtering with tag
[github/wallabag/wallabag.git] / tests / Wallabag / CoreBundle / Controller / ExportControllerTest.php
index 9f35a44877f8904eb3ed497eec664e4059bc73af..5ca886bd4d9e0a61ba29c12c76aac8ee80e948df 100644 (file)
@@ -117,6 +117,17 @@ class ExportControllerTest extends WallabagCoreTestCase
         $this->assertEquals('application/pdf', $headers->get('content-type'));
         $this->assertEquals('attachment; filename="All articles.pdf"', $headers->get('content-disposition'));
         $this->assertEquals('binary', $headers->get('content-transfer-encoding'));
+
+        ob_start();
+        $crawler = $client->request('GET', '/export/tag_entries.pdf?tag=foo');
+        ob_end_clean();
+
+        $this->assertEquals(200, $client->getResponse()->getStatusCode());
+
+        $headers = $client->getResponse()->headers;
+        $this->assertEquals('application/pdf', $headers->get('content-type'));
+        $this->assertEquals('attachment; filename="Tag_entries articles.pdf"', $headers->get('content-disposition'));
+        $this->assertEquals('binary', $headers->get('content-transfer-encoding'));
     }
 
     public function testTxtExport()
@@ -193,7 +204,7 @@ class ExportControllerTest extends WallabagCoreTestCase
         $contentInDB = $client->getContainer()
             ->get('doctrine.orm.entity_manager')
             ->getRepository('WallabagCoreBundle:Entry')
-            ->findOneByUsernameAndNotArchived('admin');
+            ->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId());
 
         ob_start();
         $crawler = $client->request('GET', '/export/'.$contentInDB->getId().'.json');