aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-09-13 09:57:35 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-09-13 10:11:22 +0200
commit497e0cad7ca2d2e771c8d41f7bc50ab2bc222cdb (patch)
tree9da03f14eab17a8b32b8d6250d90d76b87302be2
parent616f9fea26af9d9c9dd6134388811c120f1e9656 (diff)
downloadwallabag-497e0cad7ca2d2e771c8d41f7bc50ab2bc222cdb.tar.gz
wallabag-497e0cad7ca2d2e771c8d41f7bc50ab2bc222cdb.tar.zst
wallabag-497e0cad7ca2d2e771c8d41f7bc50ab2bc222cdb.zip
add test for previewPicture filter
-rw-r--r--src/Wallabag/CoreBundle/Filter/EntryFilterType.php4
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php13
2 files changed, 14 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php
index 11c69abd..de95eed9 100644
--- a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php
+++ b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php
@@ -45,9 +45,7 @@ class EntryFilterType extends AbstractType
45 ->add('isStarred', 'filter_checkbox') 45 ->add('isStarred', 'filter_checkbox')
46 ->add('previewPicture', 'filter_checkbox', array( 46 ->add('previewPicture', 'filter_checkbox', array(
47 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { 47 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
48 $value = $values['value']; 48 if (false === $values['value']) {
49
50 if (false === $value) {
51 return; 49 return;
52 } 50 }
53 51
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index a0966285..5798009c 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -369,4 +369,17 @@ class EntryControllerTest extends WallabagCoreTestCase
369 $crawler = $client->submit($form); 369 $crawler = $client->submit($form);
370 $this->assertCount(1, $crawler->filter('div[class=entry]')); 370 $this->assertCount(1, $crawler->filter('div[class=entry]'));
371 } 371 }
372
373 public function testPreviewPictureFilter()
374 {
375 $this->logInAs('admin');
376 $client = $this->getClient();
377
378 $crawler = $client->request('GET', '/unread/list');
379 $form = $crawler->filter('button[id=submit-filter]')->form();
380 $form['entry_filter[previewPicture]']->tick();
381
382 $crawler = $client->submit($form);
383 $this->assertCount(1, $crawler->filter('div[class=entry]'));
384 }
372} 385}