]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
add filter on domain name
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Tests / Controller / EntryControllerTest.php
index 87c164157c928149a0daaf9c1bb35bcc1cd79cba..8d013ec002c626b73b3c9fbd59b70ad374e4e380 100644 (file)
@@ -293,7 +293,6 @@ class EntryControllerTest extends WallabagCoreTestCase
     {
         $this->logInAs('admin');
         $client = $this->getClient();
-
         $crawler = $client->request('GET', '/config');
 
         $form = $crawler->filter('button[id=config_save]')->form();
@@ -310,4 +309,27 @@ class EntryControllerTest extends WallabagCoreTestCase
 
         $this->assertContains($parameters, $client->getResponse()->getContent());
     }
+
+    public function testFilterOnDomainName()
+    {
+        $this->logInAs('admin');
+        $client = $this->getClient();
+
+        $crawler = $client->request('GET', '/unread/list');
+        $form = $crawler->filter('button[id=submit-filter]')->form();
+        $data = array(
+            'entry_filter[domainName]' => 'monde'
+        );
+
+        $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[domainName]' => 'wallabag'
+        );
+
+        $crawler = $client->submit($form, $data);
+        $this->assertCount(0, $crawler->filter('div[class=entry]'));
+    }
 }