aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-08-17 15:15:51 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-08-17 15:15:51 +0200
commitab2c93c7eb644f89c01793be2b9f097943b3b791 (patch)
treec5812900ef35b99b16dbfa319ac3f21c429f828f /src
parentc14a7c42519263bcbcbb9fb8d843ca18de9c5f01 (diff)
downloadwallabag-ab2c93c7eb644f89c01793be2b9f097943b3b791.tar.gz
wallabag-ab2c93c7eb644f89c01793be2b9f097943b3b791.tar.zst
wallabag-ab2c93c7eb644f89c01793be2b9f097943b3b791.zip
add test
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig2
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php22
3 files changed, 24 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig
index 539c035f..a794df0e 100644
--- a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig
@@ -10,7 +10,7 @@
10 <div class="pagination"> 10 <div class="pagination">
11 {% for p in range(1, entries.nbPages) if entries.nbPages > 1 %} 11 {% for p in range(1, entries.nbPages) if entries.nbPages > 1 %}
12 <li> 12 <li>
13 <a href="{{ path(app.request.attributes.get('_route'), {'page': p}) }}" class="{{ currentPage == p ? 'current':''}}" >{{ p }}</a> 13 <a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'page': p})) }}" class="{{ currentPage == p ? 'current':''}}" >{{ p }}</a>
14 </li> 14 </li>
15 {% endfor %} 15 {% endfor %}
16 </div> 16 </div>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
index e6104836..101f5939 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
@@ -22,7 +22,7 @@
22 <ul class="pagination right"> 22 <ul class="pagination right">
23 {% for p in range(1, entries.nbPages) if entries.nbPages > 1 %} 23 {% for p in range(1, entries.nbPages) if entries.nbPages > 1 %}
24 <li class="{{ currentPage == p ? 'active':'waves-effect'}}"> 24 <li class="{{ currentPage == p ? 'active':'waves-effect'}}">
25 <a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'page': p})) }}" >{{ p }}</a> 25 <a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'page': p})) }}">{{ p }}</a>
26 </li> 26 </li>
27 {% endfor %} 27 {% endfor %}
28 </div> 28 </div>
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index 24848eb2..0bd18c44 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -259,4 +259,26 @@ class EntryControllerTest extends WallabagCoreTestCase
259 259
260 $this->assertCount(1, $crawler->filter('div[class=entry]')); 260 $this->assertCount(1, $crawler->filter('div[class=entry]'));
261 } 261 }
262
263 public function testPaginationWithFilter()
264 {
265 $this->logInAs('admin');
266 $client = $this->getClient();
267
268 $crawler = $client->request('GET', '/config');
269
270 $form = $crawler->filter('button[id=config_save]')->form();
271
272 $data = array(
273 'config[items_per_page]' => '1',
274 );
275
276 $client->submit($form, $data);
277
278 $parameters = '?entry_filter%5BreadingTime%5D%5Bleft_number%5D=&amp;entry_filter%5BreadingTime%5D%5Bright_number%5D=';
279
280 $crawler = $client->request('GET', 'unread/list'.$parameters);
281
282 $this->assertContains($parameters, $client->getResponse()->getContent());
283 }
262} 284}