aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-01-25 22:25:55 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-02-04 20:31:26 +0100
commit3a2ada0be070acf2642d9ab06ce59e612538edee (patch)
tree8dd1340958fd9e9d39fb961a4f8f1bc11de2d963 /src
parent365a38984e32d152ec0170991a61bf704756cf1e (diff)
downloadwallabag-3a2ada0be070acf2642d9ab06ce59e612538edee.tar.gz
wallabag-3a2ada0be070acf2642d9ab06ce59e612538edee.tar.zst
wallabag-3a2ada0be070acf2642d9ab06ce59e612538edee.zip
fix tests
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php
index aaa26499..76c98055 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php
@@ -41,7 +41,7 @@ class ExportControllerTest extends WallabagCoreTestCase
41 $this->logInAs('admin'); 41 $this->logInAs('admin');
42 $client = $this->getClient(); 42 $client = $this->getClient();
43 43
44 $client->request('GET', '/export/unread.txt'); 44 $client->request('GET', '/export/unread.doc');
45 $this->assertEquals(404, $client->getResponse()->getStatusCode()); 45 $this->assertEquals(404, $client->getResponse()->getStatusCode());
46 46
47 $content = $client->getContainer() 47 $content = $client->getContainer()
@@ -49,7 +49,7 @@ class ExportControllerTest extends WallabagCoreTestCase
49 ->getRepository('WallabagCoreBundle:Entry') 49 ->getRepository('WallabagCoreBundle:Entry')
50 ->findOneByUsernameAndNotArchived('admin'); 50 ->findOneByUsernameAndNotArchived('admin');
51 51
52 $client->request('GET', '/export/'.$content->getId().'.txt'); 52 $client->request('GET', '/export/'.$content->getId().'.doc');
53 $this->assertEquals(404, $client->getResponse()->getStatusCode()); 53 $this->assertEquals(404, $client->getResponse()->getStatusCode());
54 } 54 }
55 55
@@ -119,6 +119,23 @@ class ExportControllerTest extends WallabagCoreTestCase
119 $this->assertEquals('binary', $headers->get('content-transfer-encoding')); 119 $this->assertEquals('binary', $headers->get('content-transfer-encoding'));
120 } 120 }
121 121
122 public function testTxtExport()
123 {
124 $this->logInAs('admin');
125 $client = $this->getClient();
126
127 ob_start();
128 $crawler = $client->request('GET', '/export/all.txt');
129 ob_end_clean();
130
131 $this->assertEquals(200, $client->getResponse()->getStatusCode());
132
133 $headers = $client->getResponse()->headers;
134 $this->assertEquals('text/plain; charset=UTF-8', $headers->get('content-type'));
135 $this->assertEquals('attachment; filename="All articles.txt"', $headers->get('content-disposition'));
136 $this->assertEquals('UTF-8', $headers->get('content-transfer-encoding'));
137 }
138
122 public function testCsvExport() 139 public function testCsvExport()
123 { 140 {
124 $this->logInAs('admin'); 141 $this->logInAs('admin');