diff --git a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php index 11c69abdf..de95eed96 100644 --- a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php @@ -45,9 +45,7 @@ class EntryFilterType extends AbstractType ->add('isStarred', 'filter_checkbox') ->add('previewPicture', 'filter_checkbox', array( 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { - $value = $values['value']; - - if (false === $value) { + if (false === $values['value']) { return; } diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php index a09662858..5798009ca 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 $crawler = $client->submit($form); $this->assertCount(1, $crawler->filter('div[class=entry]')); } + + public function testPreviewPictureFilter() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/unread/list'); + $form = $crawler->filter('button[id=submit-filter]')->form(); + $form['entry_filter[previewPicture]']->tick(); + + $crawler = $client->submit($form); + $this->assertCount(1, $crawler->filter('div[class=entry]')); + } }