]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
Entries filter on language
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Tests / Controller / EntryControllerTest.php
index 77b57884679d0dbd0651ed37ce27ae9ba799908c..cbd84a979ca9a9f5345657738837e708a94c4dd5 100644 (file)
@@ -382,4 +382,27 @@ class EntryControllerTest extends WallabagCoreTestCase
         $crawler = $client->submit($form);
         $this->assertCount(1, $crawler->filter('div[class=entry]'));
     }
+
+    public function testFilterOnLanguage()
+    {
+        $this->logInAs('admin');
+        $client = $this->getClient();
+
+        $crawler = $client->request('GET', '/unread/list');
+        $form = $crawler->filter('button[id=submit-filter]')->form();
+        $data = array(
+            'entry_filter[language]' => 'de',
+        );
+
+        $crawler = $client->submit($form, $data);
+        $this->assertCount(1, $crawler->filter('div[class=entry]'));
+
+        $form = $crawler->filter('button[id=submit-filter]')->form();
+        $data = array(
+            'entry_filter[language]' => 'en',
+        );
+
+        $crawler = $client->submit($form, $data);
+        $this->assertCount(2, $crawler->filter('div[class=entry]'));
+    }
 }