From 95859e54c512ec4a3ee1c28404981f5c4b9481df Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 23 Jun 2016 10:46:47 +0200 Subject: [PATCH] Add some tests about readingTime --- .../Controller/EntryControllerTest.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index bea771bc..5c739c78 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -499,6 +499,42 @@ class EntryControllerTest extends WallabagCoreTestCase $this->assertCount(1, $crawler->filter('div[class=entry]')); } + public function testFilterOnReadingTimeOnlyUpper() + { + $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, + ]; + + $crawler = $client->submit($form, $data); + + $this->assertCount(2, $crawler->filter('div[class=entry]')); + } + + public function testFilterOnReadingTimeOnlyLower() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/unread/list'); + + $form = $crawler->filter('button[id=submit-filter]')->form(); + + $data = [ + 'entry_filter[readingTime][left_number]' => 22, + ]; + + $crawler = $client->submit($form, $data); + + $this->assertCount(4, $crawler->filter('div[class=entry]')); + } + public function testFilterOnUnreadStatus() { $this->logInAs('admin'); -- 2.41.0