From 1b1647175d7eaa2800a2eff9f984ef37e9976fba Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 9 May 2017 12:12:23 +0200 Subject: Add some tests --- .../CoreBundle/Controller/EntryControllerTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php') diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 3eb6d47f..7db4cf1f 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -591,6 +591,26 @@ class EntryControllerTest extends WallabagCoreTestCase $this->assertCount(1, $crawler->filter('div[class=entry]')); } + public function testFilterOnReadingTimeWithNegativeValue() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/unread/list'); + + $form = $crawler->filter('button[id=submit-filter]')->form(); + + $data = [ + 'entry_filter[readingTime][right_number]' => -22, + 'entry_filter[readingTime][left_number]' => -22, + ]; + + $crawler = $client->submit($form, $data); + + // forcing negative value results in no entry displayed + $this->assertCount(0, $crawler->filter('div[class=entry]')); + } + public function testFilterOnReadingTimeOnlyUpper() { $this->logInAs('admin'); -- cgit v1.2.3