diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-11-18 15:09:21 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-11-18 15:09:21 +0100 |
commit | 10b3509757c704943aa9cdd69c1d02bedfa937a3 (patch) | |
tree | 2fee613487ecea37a2b938611dd3711248774818 /tests/Wallabag/CoreBundle/Controller | |
parent | b060fbdfe763bf4fa2b17d43bccc6751cefd0d2c (diff) | |
download | wallabag-10b3509757c704943aa9cdd69c1d02bedfa937a3.tar.gz wallabag-10b3509757c704943aa9cdd69c1d02bedfa937a3.tar.zst wallabag-10b3509757c704943aa9cdd69c1d02bedfa937a3.zip |
Added http_status in Entry entity
Diffstat (limited to 'tests/Wallabag/CoreBundle/Controller')
-rw-r--r-- | tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index bf4e0543..771903fe 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | |||
@@ -961,4 +961,50 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
961 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 961 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); |
962 | $this->assertContains('/view/'.$content->getId(), $client->getResponse()->headers->get('location')); | 962 | $this->assertContains('/view/'.$content->getId(), $client->getResponse()->headers->get('location')); |
963 | } | 963 | } |
964 | |||
965 | public function testFilterOnHttpStatus() | ||
966 | { | ||
967 | $this->logInAs('admin'); | ||
968 | $client = $this->getClient(); | ||
969 | |||
970 | $crawler = $client->request('GET', '/new'); | ||
971 | $form = $crawler->filter('form[name=entry]')->form(); | ||
972 | |||
973 | $data = [ | ||
974 | 'entry[url]' => 'http://www.lemonde.fr/incorrect-url/', | ||
975 | ]; | ||
976 | |||
977 | $client->submit($form, $data); | ||
978 | |||
979 | $crawler = $client->request('GET', '/all/list'); | ||
980 | $form = $crawler->filter('button[id=submit-filter]')->form(); | ||
981 | |||
982 | $data = [ | ||
983 | 'entry_filter[httpStatus]' => 404, | ||
984 | ]; | ||
985 | |||
986 | $crawler = $client->submit($form, $data); | ||
987 | |||
988 | $this->assertCount(1, $crawler->filter('div[class=entry]')); | ||
989 | |||
990 | $crawler = $client->request('GET', '/new'); | ||
991 | $form = $crawler->filter('form[name=entry]')->form(); | ||
992 | |||
993 | $data = [ | ||
994 | 'entry[url]' => 'http://www.nextinpact.com/news/101235-wallabag-alternative-libre-a-pocket-creuse-petit-a-petit-son-nid.htm', | ||
995 | ]; | ||
996 | |||
997 | $client->submit($form, $data); | ||
998 | |||
999 | $crawler = $client->request('GET', '/all/list'); | ||
1000 | $form = $crawler->filter('button[id=submit-filter]')->form(); | ||
1001 | |||
1002 | $data = [ | ||
1003 | 'entry_filter[httpStatus]' => 200, | ||
1004 | ]; | ||
1005 | |||
1006 | $crawler = $client->submit($form, $data); | ||
1007 | |||
1008 | $this->assertCount(1, $crawler->filter('div[class=entry]')); | ||
1009 | } | ||
964 | } | 1010 | } |