diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller')
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php index 3f749aae..febdf4d4 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php | |||
@@ -113,4 +113,38 @@ class ExportControllerTest extends WallabagCoreTestCase | |||
113 | $this->assertGreaterThan(1, $csv); | 113 | $this->assertGreaterThan(1, $csv); |
114 | $this->assertEquals('Title;URL;Content;Tags;"MIME Type";Language', $csv[0]); | 114 | $this->assertEquals('Title;URL;Content;Tags;"MIME Type";Language', $csv[0]); |
115 | } | 115 | } |
116 | |||
117 | public function testJsonExport() | ||
118 | { | ||
119 | $this->logInAs('admin'); | ||
120 | $client = $this->getClient(); | ||
121 | |||
122 | ob_start(); | ||
123 | $crawler = $client->request('GET', '/export/all.json'); | ||
124 | ob_end_clean(); | ||
125 | |||
126 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | ||
127 | |||
128 | $headers = $client->getResponse()->headers; | ||
129 | $this->assertEquals('application/json', $headers->get('content-type')); | ||
130 | $this->assertEquals('attachment; filename="All articles.json"', $headers->get('content-disposition')); | ||
131 | $this->assertEquals('UTF-8', $headers->get('content-transfer-encoding')); | ||
132 | } | ||
133 | |||
134 | public function testXmlExport() | ||
135 | { | ||
136 | $this->logInAs('admin'); | ||
137 | $client = $this->getClient(); | ||
138 | |||
139 | ob_start(); | ||
140 | $crawler = $client->request('GET', '/export/unread.xml'); | ||
141 | ob_end_clean(); | ||
142 | |||
143 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | ||
144 | |||
145 | $headers = $client->getResponse()->headers; | ||
146 | $this->assertEquals('application/xml', $headers->get('content-type')); | ||
147 | $this->assertEquals('attachment; filename="Unread articles.xml"', $headers->get('content-disposition')); | ||
148 | $this->assertEquals('UTF-8', $headers->get('content-transfer-encoding')); | ||
149 | } | ||
116 | } | 150 | } |