]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
add test 1352/head
authorNicolas Lœuillet <nicolas@loeuillet.org>
Mon, 17 Aug 2015 13:15:51 +0000 (15:15 +0200)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Mon, 17 Aug 2015 13:15:51 +0000 (15:15 +0200)
src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php

index 539c035fa65f7e1d2b8f14e8c0d90ae3a0b3d07e..a794df0e57e22e47a8898ef9f5c5aac96d77f688 100644 (file)
@@ -10,7 +10,7 @@
             <div class="pagination">
                 {% for p in range(1, entries.nbPages) if entries.nbPages > 1 %}
                     <li>
-                        <a href="{{ path(app.request.attributes.get('_route'), {'page': p}) }}" class="{{ currentPage == p ? 'current':''}}" >{{ p }}</a>
+                        <a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'page': p})) }}" class="{{ currentPage == p ? 'current':''}}" >{{ p }}</a>
                     </li>
                 {% endfor %}
             </div>
index e610483626799cd531c2ea1ae194b41b0faf7240..101f5939580c353bef8b55271e99b7debbb86c38 100644 (file)
@@ -22,7 +22,7 @@
             <ul class="pagination right">
                 {% for p in range(1, entries.nbPages) if entries.nbPages > 1 %}
                     <li class="{{ currentPage == p ? 'active':'waves-effect'}}">
-                        <a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'page': p})) }}"  >{{ p }}</a>
+                        <a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'page': p})) }}">{{ p }}</a>
                     </li>
                 {% endfor %}
             </div>
index 24848eb2f15e0ff198bc57ab278749d89c635d12..0bd18c4421a3d75766208d6151a3028df9e2ca7b 100644 (file)
@@ -259,4 +259,26 @@ class EntryControllerTest extends WallabagCoreTestCase
 
         $this->assertCount(1, $crawler->filter('div[class=entry]'));
     }
+
+    public function testPaginationWithFilter()
+    {
+        $this->logInAs('admin');
+        $client = $this->getClient();
+
+        $crawler = $client->request('GET', '/config');
+
+        $form = $crawler->filter('button[id=config_save]')->form();
+
+        $data = array(
+            'config[items_per_page]' => '1',
+        );
+
+        $client->submit($form, $data);
+
+        $parameters = '?entry_filter%5BreadingTime%5D%5Bleft_number%5D=&amp;entry_filter%5BreadingTime%5D%5Bright_number%5D=';
+
+        $crawler = $client->request('GET', 'unread/list'.$parameters);
+
+        $this->assertContains($parameters, $client->getResponse()->getContent());
+    }
 }