]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Add unread filter test to EntryControllerTest 2052/head
authorDaniel Bartram <me@danielbartram.com>
Mon, 9 May 2016 18:48:28 +0000 (19:48 +0100)
committerDaniel Bartram <me@danielbartram.com>
Mon, 9 May 2016 18:48:28 +0000 (19:48 +0100)
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.

src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php

index df4c34cd8340481de88657d43ef6426d51635abe..c7087a714709ff7430e9f87ad3b15589bc28ce33 100644 (file)
@@ -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');