Completed
Push — master ( ca6ae8...097e20 )
by Ivannis Suárez
09:32
created
Doctrine/Tests/Units/ODM/MongoDB/Query/SpecificationVisitorTests.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     {
42 42
         $this->visitTest(
43 43
             Criteria::property('foo')->eq(10)->andX(Criteria::property('bar')->eq(20)),
44
-            function () {
44
+            function() {
45 45
                 return  $this->createQueryBuilder()
46 46
                     ->field('foo')->equals(10)
47 47
                     ->field('bar')->equals(20);
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
         $this->visitTest(
52 52
             Criteria::property('foo')->gt(10)->andX(Criteria::property('foo')->lt(20)),
53
-            function () {
53
+            function() {
54 54
                 return $this->createQueryBuilder()
55 55
                     ->field('foo')->gt(10)
56 56
                     ->field('foo')->lt(20);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
                 Criteria::property('foo')->lt(20)->orX(Criteria::property('bar')->lt(20)),
63 63
                 Criteria::property('foo')->gt(10)->orX(Criteria::property('foo')->lt(25))
64 64
             ),
65
-            function () {
65
+            function() {
66 66
                 $qb = $this->createQueryBuilder();
67 67
 
68 68
                 return $qb
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     {
84 84
         $this->visitTest(
85 85
             Criteria::property('foo')->eq(10)->orX(Criteria::property('bar')->eq(20)),
86
-            function () {
86
+            function() {
87 87
                 $qb = $this->createQueryBuilder();
88 88
 
89 89
                 return $qb
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public function testVisitNot()
100 100
     {
101
-        $this->visitTest(new NotSpecification(Criteria::property('foo')->eq(10)), function () {
101
+        $this->visitTest(new NotSpecification(Criteria::property('foo')->eq(10)), function() {
102 102
             $qb = $this->createQueryBuilder();
103 103
 
104 104
             return $qb->not($qb->expr()->field('foo')->equals(10));
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      */
143 143
     public function testVisitCallback()
144 144
     {
145
-        $this->notSupportedOperationTest(Criteria::callback(function () {
145
+        $this->notSupportedOperationTest(Criteria::callback(function() {
146 146
 
147 147
         })->selector());
148 148
     }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      */
178 178
     public function tesVisittGreaterThan()
179 179
     {
180
-        $this->visitTest(Criteria::property('foo')->gt(10), function () {
180
+        $this->visitTest(Criteria::property('foo')->gt(10), function() {
181 181
             return $this->createQueryBuilder()->field('foo')->gt(10);
182 182
         });
183 183
     }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
      */
188 188
     public function testVisitGreaterThanEqual()
189 189
     {
190
-        $this->visitTest(Criteria::property('foo')->gte(10), function () {
190
+        $this->visitTest(Criteria::property('foo')->gte(10), function() {
191 191
             return $this->createQueryBuilder()->field('foo')->gte(10);
192 192
         });
193 193
     }
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
      */
198 198
     public function testVisitLessThan()
199 199
     {
200
-        $this->visitTest(Criteria::property('foo')->lt(10), function () {
200
+        $this->visitTest(Criteria::property('foo')->lt(10), function() {
201 201
             return $this->createQueryBuilder()->field('foo')->lt(10);
202 202
         });
203 203
     }
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
      */
208 208
     public function testVisitLessThanEqual()
209 209
     {
210
-        $this->visitTest(Criteria::property('foo')->lte(10), function () {
210
+        $this->visitTest(Criteria::property('foo')->lte(10), function() {
211 211
             return $this->createQueryBuilder()->field('foo')->lte(10);
212 212
         });
213 213
     }
@@ -217,26 +217,26 @@  discard block
 block discarded – undo
217 217
      */
218 218
     public function testVisitEqual()
219 219
     {
220
-        $this->visitTest(Criteria::property('foo')->eq(10), function () {
220
+        $this->visitTest(Criteria::property('foo')->eq(10), function() {
221 221
             return $this->createQueryBuilder()->field('foo')->equals(10);
222 222
         });
223 223
 
224
-        $this->visitTest(Criteria::property('foo')->count()->eq(10), function () {
224
+        $this->visitTest(Criteria::property('foo')->count()->eq(10), function() {
225 225
             return $this->createQueryBuilder()->field('foo')->size(10);
226 226
         });
227 227
 
228 228
         $user = new User(UserId::next(), 'user', 20, $this->faker->email);
229 229
 
230
-        $this->visitTest(Criteria::eq($user), function () use ($user) {
230
+        $this->visitTest(Criteria::eq($user), function() use ($user) {
231 231
             return $this->createQueryBuilder()->field('id')->equals($user->id()->toNative());
232 232
         });
233 233
 
234
-        $this->visitTest(Criteria::property('id')->eq($user->id()), function () use ($user) {
234
+        $this->visitTest(Criteria::property('id')->eq($user->id()), function() use ($user) {
235 235
             return $this->createQueryBuilder()->field('id')->equals($user->id()->toNative());
236 236
         });
237 237
 
238 238
         $this->logicExceptionTest(
239
-            Criteria::callback(function () {
239
+            Criteria::callback(function() {
240 240
 
241 241
             })->eq(10)
242 242
         );
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      */
250 250
     public function testVisitNotEqual()
251 251
     {
252
-        $this->visitTest(Criteria::property('foo')->neq(10), function () {
252
+        $this->visitTest(Criteria::property('foo')->neq(10), function() {
253 253
             return $this->createQueryBuilder()->field('foo')->notEqual(10);
254 254
         });
255 255
     }
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
      */
260 260
     public function testVisitSame()
261 261
     {
262
-        $this->visitTest(Criteria::property('foo')->same(10), function () {
262
+        $this->visitTest(Criteria::property('foo')->same(10), function() {
263 263
             return $this->createQueryBuilder()->field('foo')->equals(10);
264 264
         });
265 265
     }
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
      */
270 270
     public function testVisitNotSame()
271 271
     {
272
-        $this->visitTest(Criteria::property('foo')->notsame(10), function () {
272
+        $this->visitTest(Criteria::property('foo')->notsame(10), function() {
273 273
             return $this->createQueryBuilder()->field('foo')->notEqual(10);
274 274
         });
275 275
     }
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
      */
280 280
     public function testVisitAll()
281 281
     {
282
-        $this->visitTest(Criteria::property('foo')->all(Criteria::property('bar')->gt(10)), function () {
282
+        $this->visitTest(Criteria::property('foo')->all(Criteria::property('bar')->gt(10)), function() {
283 283
             $qb = $this->createQueryBuilder();
284 284
 
285 285
             return $qb->field('foo')->all(
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
      */
296 296
     public function testAtLeast()
297 297
     {
298
-        $this->visitTest(Criteria::property('foo')->any(Criteria::property('bar')->gt(10)), function () {
298
+        $this->visitTest(Criteria::property('foo')->any(Criteria::property('bar')->gt(10)), function() {
299 299
             $qb = $this->createQueryBuilder();
300 300
 
301 301
             return $qb->field('foo')
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
     protected function visitFieldTest($field, $expected = null)
332 332
     {
333 333
         $expected = $expected === null && $field instanceof Field ? $field->name() : $expected;
334
-        $this->visitTest($field, function () use ($expected) {
334
+        $this->visitTest($field, function() use ($expected) {
335 335
             return $this->createQueryBuilder()->field($expected)->equals(true);
336 336
         });
337 337
     }
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
         $this
353 353
             ->given($qb = $this->createQueryBuilder())
354 354
             ->given($visitor = $this->createVisitor($qb))
355
-            ->exception(function () use ($visitor, $criteria) {
355
+            ->exception(function() use ($visitor, $criteria) {
356 356
                 $criteria->accept($visitor);
357 357
             })
358 358
                 ->isInstanceOf(\LogicException::class)
Please login to merge, or discard this patch.