From: Daniel Bartram Date: Mon, 9 May 2016 18:48:28 +0000 (+0100) Subject: Add unread filter test to EntryControllerTest X-Git-Tag: 2.0.5~3^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=30334567a3a4c82a8bf97fc2fb95b87bb495add1;hp=733b2cf19b5d5a93617f24b2447b9a30ba22d303;p=github%2Fwallabag%2Fwallabag.git 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. --- 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');