diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-02-04 20:53:42 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-02-04 20:53:42 +0100 |
commit | 22a267aeffa9e5b7d63e6a149501f9a1448e925f (patch) | |
tree | b1aa51f9a0f128cd3e364118b55f1335058a84f0 /src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php | |
parent | 27c837dcd1640a7f5f0ed197e882eefd53ba8273 (diff) | |
parent | eb15061d0b98491d581f9ad0b76671bfcbdd40f1 (diff) | |
download | wallabag-22a267aeffa9e5b7d63e6a149501f9a1448e925f.tar.gz wallabag-22a267aeffa9e5b7d63e6a149501f9a1448e925f.tar.zst wallabag-22a267aeffa9e5b7d63e6a149501f9a1448e925f.zip |
Merge pull request #1633 from wallabag/exporttxt
Exporttxt
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php')
-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'); |