mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-23 08:06:33 +00:00
add test for previewPicture filter
This commit is contained in:
parent
616f9fea26
commit
497e0cad7c
2 changed files with 14 additions and 3 deletions
|
@ -45,9 +45,7 @@ class EntryFilterType extends AbstractType
|
||||||
->add('isStarred', 'filter_checkbox')
|
->add('isStarred', 'filter_checkbox')
|
||||||
->add('previewPicture', 'filter_checkbox', array(
|
->add('previewPicture', 'filter_checkbox', array(
|
||||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||||
$value = $values['value'];
|
if (false === $values['value']) {
|
||||||
|
|
||||||
if (false === $value) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -369,4 +369,17 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
$crawler = $client->submit($form);
|
$crawler = $client->submit($form);
|
||||||
$this->assertCount(1, $crawler->filter('div[class=entry]'));
|
$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]'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue