1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

Added http_status in Entry entity

This commit is contained in:
Nicolas Lœuillet 2016-11-18 15:09:21 +01:00
parent b060fbdfe7
commit 10b3509757
No known key found for this signature in database
GPG key ID: BDC1EFB5CA0145F2
23 changed files with 172 additions and 0 deletions

View file

@ -961,4 +961,50 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertContains('/view/'.$content->getId(), $client->getResponse()->headers->get('location'));
}
public function testFilterOnHttpStatus()
{
$this->logInAs('admin');
$client = $this->getClient();
$crawler = $client->request('GET', '/new');
$form = $crawler->filter('form[name=entry]')->form();
$data = [
'entry[url]' => 'http://www.lemonde.fr/incorrect-url/',
];
$client->submit($form, $data);
$crawler = $client->request('GET', '/all/list');
$form = $crawler->filter('button[id=submit-filter]')->form();
$data = [
'entry_filter[httpStatus]' => 404,
];
$crawler = $client->submit($form, $data);
$this->assertCount(1, $crawler->filter('div[class=entry]'));
$crawler = $client->request('GET', '/new');
$form = $crawler->filter('form[name=entry]')->form();
$data = [
'entry[url]' => 'http://www.nextinpact.com/news/101235-wallabag-alternative-libre-a-pocket-creuse-petit-a-petit-son-nid.htm',
];
$client->submit($form, $data);
$crawler = $client->request('GET', '/all/list');
$form = $crawler->filter('button[id=submit-filter]')->form();
$data = [
'entry_filter[httpStatus]' => 200,
];
$crawler = $client->submit($form, $data);
$this->assertCount(1, $crawler->filter('div[class=entry]'));
}
}