mirror of
https://github.com/wallabag/wallabag.git
synced 2024-10-31 22:28:54 +00:00
fix tests
This commit is contained in:
parent
365a38984e
commit
3a2ada0be0
1 changed files with 19 additions and 2 deletions
|
@ -41,7 +41,7 @@ class ExportControllerTest extends WallabagCoreTestCase
|
|||
$this->logInAs('admin');
|
||||
$client = $this->getClient();
|
||||
|
||||
$client->request('GET', '/export/unread.txt');
|
||||
$client->request('GET', '/export/unread.doc');
|
||||
$this->assertEquals(404, $client->getResponse()->getStatusCode());
|
||||
|
||||
$content = $client->getContainer()
|
||||
|
@ -49,7 +49,7 @@ class ExportControllerTest extends WallabagCoreTestCase
|
|||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->findOneByUsernameAndNotArchived('admin');
|
||||
|
||||
$client->request('GET', '/export/'.$content->getId().'.txt');
|
||||
$client->request('GET', '/export/'.$content->getId().'.doc');
|
||||
$this->assertEquals(404, $client->getResponse()->getStatusCode());
|
||||
}
|
||||
|
||||
|
@ -119,6 +119,23 @@ class ExportControllerTest extends WallabagCoreTestCase
|
|||
$this->assertEquals('binary', $headers->get('content-transfer-encoding'));
|
||||
}
|
||||
|
||||
public function testTxtExport()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getClient();
|
||||
|
||||
ob_start();
|
||||
$crawler = $client->request('GET', '/export/all.txt');
|
||||
ob_end_clean();
|
||||
|
||||
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
$headers = $client->getResponse()->headers;
|
||||
$this->assertEquals('text/plain; charset=UTF-8', $headers->get('content-type'));
|
||||
$this->assertEquals('attachment; filename="All articles.txt"', $headers->get('content-disposition'));
|
||||
$this->assertEquals('UTF-8', $headers->get('content-transfer-encoding'));
|
||||
}
|
||||
|
||||
public function testCsvExport()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
|
|
Loading…
Reference in a new issue