aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2017-05-09 12:12:23 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2017-05-09 12:12:23 +0200
commit1b1647175d7eaa2800a2eff9f984ef37e9976fba (patch)
tree590f6b5a66c573972aca1220abf28d13b59a34f9 /src/Wallabag
parent1267905d283afc8a0140da007d8428d533964839 (diff)
downloadwallabag-1b1647175d7eaa2800a2eff9f984ef37e9976fba.tar.gz
wallabag-1b1647175d7eaa2800a2eff9f984ef37e9976fba.tar.zst
wallabag-1b1647175d7eaa2800a2eff9f984ef37e9976fba.zip
Add some tests
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
index ab27ec8e..556578d1 100644
--- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
@@ -34,7 +34,7 @@ class EntryFilterType extends AbstractType
34 $this->user = $tokenStorage->getToken() ? $tokenStorage->getToken()->getUser() : null; 34 $this->user = $tokenStorage->getToken() ? $tokenStorage->getToken()->getUser() : null;
35 35
36 if (null === $this->user || !is_object($this->user)) { 36 if (null === $this->user || !is_object($this->user)) {
37 return null; 37 return;
38 } 38 }
39 } 39 }
40 40
@@ -42,8 +42,14 @@ class EntryFilterType extends AbstractType
42 { 42 {
43 $builder 43 $builder
44 ->add('readingTime', NumberRangeFilterType::class, [ 44 ->add('readingTime', NumberRangeFilterType::class, [
45 'left_number_options' => ['condition_operator' => FilterOperands::OPERATOR_GREATER_THAN_EQUAL, 'attr' => ['min' => 0]], 45 'left_number_options' => [
46 'right_number_options' => ['condition_operator' => FilterOperands::OPERATOR_LOWER_THAN_EQUAL, 'attr' => ['min' => 0]], 46 'condition_operator' => FilterOperands::OPERATOR_GREATER_THAN_EQUAL,
47 'attr' => ['min' => 0],
48 ],
49 'right_number_options' => [
50 'condition_operator' => FilterOperands::OPERATOR_LOWER_THAN_EQUAL,
51 'attr' => ['min' => 0],
52 ],
47 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { 53 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
48 $lower = $values['value']['left_number'][0]; 54 $lower = $values['value']['left_number'][0];
49 $upper = $values['value']['right_number'][0]; 55 $upper = $values['value']['right_number'][0];