@@ -133,9 +133,10 @@ public function testDdFilterOr()
133
133
'Parameter dd_p2 ' );
134
134
}
135
135
136
- public function testDdFilterAndWithExtsionCriterium ()
136
+ public function testDdFilterAndWithExtsionCriteria ()
137
137
{
138
- $ this ->testEntityQb ->andWhere ('o.numb >= 0 ' );
138
+ $ this ->testEntityQb ->orWhere ('o.numb >= 0 ' );
139
+ $ this ->testEntityQb ->orWhere ('o.numb <= 999 ' );
139
140
$ reqData = null ;
140
141
parse_str ('exists[bool]=true&and[or][dd][after]=2021-01-01 ' , $ reqData );
141
142
// var_dump($reqData);
@@ -147,10 +148,10 @@ public function testDdFilterAndWithExtsionCriterium()
147
148
$ this ->assertEquals (
148
149
str_replace ('
149
150
' , '' , "SELECT o FROM Metaclass\FilterBundle\Entity\TestEntity o WHERE
150
- o.numb >= 0 AND (
151
+ ( o.numb >= 0 OR o.numb <= 999) AND
151
152
o.bool IS NOT NULL
152
153
AND (o.dd >= :dd_p1 OR o.dd IS NULL)
153
- ) " ),
154
+ " ),
154
155
$ this ->testEntityQb ->getDQL (),
155
156
'DQL ' );
156
157
$ this ->assertEquals (
@@ -160,9 +161,10 @@ public function testDdFilterAndWithExtsionCriterium()
160
161
161
162
}
162
163
163
- public function testDdFilterNotWithExtsionCriterium ()
164
+ public function testDdFilterNotWithExtsionCriteria ()
164
165
{
165
- $ this ->testEntityQb ->andWhere ('o.numb >= 0 ' );
166
+ $ this ->testEntityQb ->orWhere ('o.numb >= 0 ' );
167
+ $ this ->testEntityQb ->orWhere ('o.numb <= 999 ' );
166
168
$ reqData = null ;
167
169
parse_str ('exists[bool]=true¬[dd][after]=2021-01-01 ' , $ reqData );
168
170
// var_dump($reqData);
@@ -174,9 +176,9 @@ public function testDdFilterNotWithExtsionCriterium()
174
176
$ this ->assertEquals (
175
177
str_replace ('
176
178
' , '' , "SELECT o FROM Metaclass\FilterBundle\Entity\TestEntity o WHERE
177
- o.numb >= 0 AND (
179
+ ( o.numb >= 0 OR o.numb <= 999) AND
178
180
o.bool IS NOT NULL
179
- AND (NOT(o.dd >= :dd_p1 OR o.dd IS NULL))) " ),
181
+ AND (NOT(o.dd >= :dd_p1 OR o.dd IS NULL)) " ),
180
182
$ this ->testEntityQb ->getDQL (),
181
183
'DQL ' );
182
184
$ this ->assertEquals (
@@ -185,9 +187,10 @@ public function testDdFilterNotWithExtsionCriterium()
185
187
'Parameter dd_p1 ' );
186
188
}
187
189
188
- public function testDdFilterOrWithExtsionCriterium ()
190
+ public function testDdFilterOrWithExtsionCriteria ()
189
191
{
190
- $ this ->testEntityQb ->andWhere ('o.numb >= 0 ' );
192
+ $ this ->testEntityQb ->orWhere ('o.numb >= 0 ' );
193
+ $ this ->testEntityQb ->orWhere ('o.numb <= 999 ' );
191
194
$ reqData = null ;
192
195
parse_str ('exists[bool]=true&or[dd][after]=2021-01-01&or[dd][before]=2010-02-02 ' , $ reqData );
193
196
// var_dump($reqData);
@@ -199,7 +202,7 @@ public function testDdFilterOrWithExtsionCriterium()
199
202
$ this ->assertEquals (
200
203
str_replace ('
201
204
' , '' , "SELECT o FROM Metaclass\FilterBundle\Entity\TestEntity o WHERE
202
- o.numb >= 0 AND (
205
+ ( o.numb >= 0 OR o.numb <= 999) AND (
203
206
o.bool IS NOT NULL
204
207
OR (
205
208
(o.dd <= :dd_p1 AND o.dd IS NOT NULL)
0 commit comments