]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
Merge remote-tracking branch 'origin/master' into 2.3
[github/wallabag/wallabag.git] / tests / Wallabag / CoreBundle / Controller / EntryControllerTest.php
index 698e5e1309cef786e9d825f18ffcd5aabba4db6f..19c8698edeb083b82c0831a6bed716945f8452ad 100644 (file)
@@ -627,6 +627,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');