From 26ed851f529fe3a50217940d47c20d9cd0f8954e Mon Sep 17 00:00:00 2001 From: Daniel Bartram Date: Mon, 9 May 2016 19:48:28 +0100 Subject: [PATCH] Add unread filter test to EntryControllerTest Add a new test to the EntryControllerTest collection which checks that only entries which have not been archived (and are treated as "unread") are retrieved. --- .../Tests/Controller/EntryControllerTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php index df4c34cd..c7087a71 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php @@ -471,6 +471,24 @@ class EntryControllerTest extends WallabagCoreTestCase $this->assertCount(1, $crawler->filter('div[class=entry]')); } + public function testFilterOnUnreadStatus() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/all/list'); + + $form = $crawler->filter('button[id=submit-filter]')->form(); + + $data = [ + 'entry_filter[isUnread]' => true, + ]; + + $crawler = $client->submit($form, $data); + + $this->assertCount(4, $crawler->filter('div[class=entry]')); + } + public function testFilterOnCreationDate() { $this->logInAs('admin'); -- 2.41.0