diff options
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php | 21 |
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'); |