@@ -69,7 +69,7 @@ public function testUpdate()
6969 $ this ->assertEquals ('John Doe ' , $ check ->name );
7070 $ this ->assertEquals (36 , $ check ->age );
7171
72- $ user ->update (array ( 'age ' => 20 ) );
72+ $ user ->update ([ 'age ' => 20 ] );
7373
7474 $ raw = $ user ->getAttributes ();
7575 $ this ->assertInstanceOf ('MongoId ' , $ raw ['_id ' ]);
@@ -180,10 +180,10 @@ public function testFind()
180180
181181 public function testGet ()
182182 {
183- User::insert (array (
184- array ( 'name ' => 'John Doe ' ) ,
185- array ( 'name ' => 'Jane Doe ' )
186- ) );
183+ User::insert ([
184+ [ 'name ' => 'John Doe ' ] ,
185+ [ 'name ' => 'Jane Doe ' ]
186+ ] );
187187
188188 $ users = User::get ();
189189 $ this ->assertEquals (2 , count ($ users ));
@@ -193,10 +193,10 @@ public function testGet()
193193
194194 public function testFirst ()
195195 {
196- User::insert (array (
197- array ( 'name ' => 'John Doe ' ) ,
198- array ( 'name ' => 'Jane Doe ' )
199- ) );
196+ User::insert ([
197+ [ 'name ' => 'John Doe ' ] ,
198+ [ 'name ' => 'Jane Doe ' ]
199+ ] );
200200
201201 $ user = User::first ();
202202 $ this ->assertInstanceOf ('Jenssegers\Mongodb\Model ' , $ user );
@@ -224,7 +224,7 @@ public function testFindOrfail()
224224
225225 public function testCreate ()
226226 {
227- $ user = User::create (array ( 'name ' => 'Jane Poe ' ) );
227+ $ user = User::create ([ 'name ' => 'Jane Poe ' ] );
228228
229229 $ this ->assertInstanceOf ('Jenssegers\Mongodb\Model ' , $ user );
230230 $ this ->assertEquals (true , $ user ->exists );
@@ -266,8 +266,8 @@ public function testTouch()
266266
267267 public function testSoftDelete ()
268268 {
269- Soft::create (array ( 'name ' => 'John Doe ' ) );
270- Soft::create (array ( 'name ' => 'Jane Doe ' ) );
269+ Soft::create ([ 'name ' => 'John Doe ' ] );
270+ Soft::create ([ 'name ' => 'Jane Doe ' ] );
271271
272272 $ this ->assertEquals (2 , Soft::count ());
273273
@@ -317,31 +317,31 @@ public function testPrimaryKey()
317317
318318 public function testScope ()
319319 {
320- Item::insert (array (
321- array ( 'name ' => 'knife ' , 'type ' => 'sharp ' ) ,
322- array ( 'name ' => 'spoon ' , 'type ' => 'round ' )
323- ) );
320+ Item::insert ([
321+ [ 'name ' => 'knife ' , 'type ' => 'sharp ' ] ,
322+ [ 'name ' => 'spoon ' , 'type ' => 'round ' ]
323+ ] );
324324
325325 $ sharp = Item::sharp ()->get ();
326326 $ this ->assertEquals (1 , $ sharp ->count ());
327327 }
328328
329329 public function testToArray ()
330330 {
331- $ item = Item::create (array ( 'name ' => 'fork ' , 'type ' => 'sharp ' ) );
331+ $ item = Item::create ([ 'name ' => 'fork ' , 'type ' => 'sharp ' ] );
332332
333333 $ array = $ item ->toArray ();
334334 $ keys = array_keys ($ array ); sort ($ keys );
335- $ this ->assertEquals (array ( '_id ' , 'created_at ' , 'name ' , 'type ' , 'updated_at ' ) , $ keys );
335+ $ this ->assertEquals ([ '_id ' , 'created_at ' , 'name ' , 'type ' , 'updated_at ' ] , $ keys );
336336 $ this ->assertTrue (is_string ($ array ['created_at ' ]));
337337 $ this ->assertTrue (is_string ($ array ['updated_at ' ]));
338338 $ this ->assertTrue (is_string ($ array ['_id ' ]));
339339 }
340340
341341 public function testUnset ()
342342 {
343- $ user1 = User::create (array ( 'name ' => 'John Doe ' , 'note1 ' => 'ABC ' , 'note2 ' => 'DEF ' ) );
344- $ user2 = User::create (array ( 'name ' => 'Jane Doe ' , 'note1 ' => 'ABC ' , 'note2 ' => 'DEF ' ) );
343+ $ user1 = User::create ([ 'name ' => 'John Doe ' , 'note1 ' => 'ABC ' , 'note2 ' => 'DEF ' ] );
344+ $ user2 = User::create ([ 'name ' => 'Jane Doe ' , 'note1 ' => 'ABC ' , 'note2 ' => 'DEF ' ] );
345345
346346 $ user1 ->unset ('note1 ' );
347347
@@ -359,7 +359,7 @@ public function testUnset()
359359 $ this ->assertTrue (isset ($ user2 ->note1 ));
360360 $ this ->assertTrue (isset ($ user2 ->note2 ));
361361
362- $ user2 ->unset (array ( 'note1 ' , 'note2 ' ) );
362+ $ user2 ->unset ([ 'note1 ' , 'note2 ' ] );
363363
364364 $ this ->assertFalse (isset ($ user2 ->note1 ));
365365 $ this ->assertFalse (isset ($ user2 ->note2 ));
@@ -368,7 +368,7 @@ public function testUnset()
368368 public function testDates ()
369369 {
370370 $ birthday = new DateTime ('1980/1/1 ' );
371- $ user = User::create (array ( 'name ' => 'John Doe ' , 'birthday ' => $ birthday) );
371+ $ user = User::create ([ 'name ' => 'John Doe ' , 'birthday ' => $ birthday] );
372372 $ this ->assertInstanceOf ('Carbon\Carbon ' , $ user ->birthday );
373373
374374 $ check = User::find ($ user ->_id );
@@ -384,20 +384,20 @@ public function testDates()
384384 $ this ->assertEquals ((string ) $ user ->created_at , $ json ['created_at ' ]);
385385
386386 // test default date format for json output
387- $ item = Item::create (array ( 'name ' => 'sword ' ) );
387+ $ item = Item::create ([ 'name ' => 'sword ' ] );
388388 $ json = $ item ->toArray ();
389389 $ this ->assertEquals ($ item ->created_at ->format ('Y-m-d H:i:s ' ), $ json ['created_at ' ]);
390390
391- $ user = User::create (array ( 'name ' => 'Jane Doe ' , 'birthday ' => time ()) );
391+ $ user = User::create ([ 'name ' => 'Jane Doe ' , 'birthday ' => time ()] );
392392 $ this ->assertInstanceOf ('Carbon\Carbon ' , $ user ->birthday );
393393
394- $ user = User::create (array ( 'name ' => 'Jane Doe ' , 'birthday ' => 'Monday 8th of August 2005 03:12:46 PM ' ) );
394+ $ user = User::create ([ 'name ' => 'Jane Doe ' , 'birthday ' => 'Monday 8th of August 2005 03:12:46 PM ' ] );
395395 $ this ->assertInstanceOf ('Carbon\Carbon ' , $ user ->birthday );
396396
397- $ user = User::create (array ( 'name ' => 'Jane Doe ' , 'birthday ' => '2005-08-08 ' ) );
397+ $ user = User::create ([ 'name ' => 'Jane Doe ' , 'birthday ' => '2005-08-08 ' ] );
398398 $ this ->assertInstanceOf ('Carbon\Carbon ' , $ user ->birthday );
399399
400- $ user = User::create (array ( 'name ' => 'Jane Doe ' , 'entry ' => array ( 'date ' => '2005-08-08 ' )) );
400+ $ user = User::create ([ 'name ' => 'Jane Doe ' , 'entry ' => [ 'date ' => '2005-08-08 ' ]] );
401401 $ this ->assertInstanceOf ('Carbon\Carbon ' , $ user ->getAttribute ('entry.date ' ));
402402
403403 $ user ->setAttribute ('entry.date ' , new DateTime );
@@ -406,55 +406,55 @@ public function testDates()
406406
407407 public function testIdAttribute ()
408408 {
409- $ user = User::create (array ( 'name ' => 'John Doe ' ) );
409+ $ user = User::create ([ 'name ' => 'John Doe ' ] );
410410 $ this ->assertEquals ($ user ->id , $ user ->_id );
411411
412- $ user = User::create (array ( 'id ' => 'custom_id ' , 'name ' => 'John Doe ' ) );
412+ $ user = User::create ([ 'id ' => 'custom_id ' , 'name ' => 'John Doe ' ] );
413413 $ this ->assertNotEquals ($ user ->id , $ user ->_id );
414414 }
415415
416416 public function testPushPull ()
417417 {
418- $ user = User::create (array ( 'name ' => 'John Doe ' ) );
418+ $ user = User::create ([ 'name ' => 'John Doe ' ] );
419419
420420 $ user ->push ('tags ' , 'tag1 ' );
421- $ user ->push ('tags ' , array ( 'tag1 ' , 'tag2 ' ) );
421+ $ user ->push ('tags ' , [ 'tag1 ' , 'tag2 ' ] );
422422 $ user ->push ('tags ' , 'tag2 ' , true );
423423
424- $ this ->assertEquals (array ( 'tag1 ' , 'tag1 ' , 'tag2 ' ) , $ user ->tags );
424+ $ this ->assertEquals ([ 'tag1 ' , 'tag1 ' , 'tag2 ' ] , $ user ->tags );
425425 $ user = User::where ('_id ' , $ user ->_id )->first ();
426- $ this ->assertEquals (array ( 'tag1 ' , 'tag1 ' , 'tag2 ' ) , $ user ->tags );
426+ $ this ->assertEquals ([ 'tag1 ' , 'tag1 ' , 'tag2 ' ] , $ user ->tags );
427427
428428 $ user ->pull ('tags ' , 'tag1 ' );
429429
430- $ this ->assertEquals (array ( 'tag2 ' ) , $ user ->tags );
430+ $ this ->assertEquals ([ 'tag2 ' ] , $ user ->tags );
431431 $ user = User::where ('_id ' , $ user ->_id )->first ();
432- $ this ->assertEquals (array ( 'tag2 ' ) , $ user ->tags );
432+ $ this ->assertEquals ([ 'tag2 ' ] , $ user ->tags );
433433
434434 $ user ->push ('tags ' , 'tag3 ' );
435- $ user ->pull ('tags ' , array ( 'tag2 ' , 'tag3 ' ) );
435+ $ user ->pull ('tags ' , [ 'tag2 ' , 'tag3 ' ] );
436436
437- $ this ->assertEquals (array () , $ user ->tags );
437+ $ this ->assertEquals ([] , $ user ->tags );
438438 $ user = User::where ('_id ' , $ user ->_id )->first ();
439- $ this ->assertEquals (array () , $ user ->tags );
439+ $ this ->assertEquals ([] , $ user ->tags );
440440 }
441441
442442 public function testRaw ()
443443 {
444- User::create (array ( 'name ' => 'John Doe ' , 'age ' => 35 ) );
445- User::create (array ( 'name ' => 'Jane Doe ' , 'age ' => 35 ) );
446- User::create (array ( 'name ' => 'Harry Hoe ' , 'age ' => 15 ) );
444+ User::create ([ 'name ' => 'John Doe ' , 'age ' => 35 ] );
445+ User::create ([ 'name ' => 'Jane Doe ' , 'age ' => 35 ] );
446+ User::create ([ 'name ' => 'Harry Hoe ' , 'age ' => 15 ] );
447447
448448 $ users = User::raw (function ($ collection )
449449 {
450- return $ collection ->find (array ( 'age ' => 35 ) );
450+ return $ collection ->find ([ 'age ' => 35 ] );
451451 });
452452 $ this ->assertInstanceOf ('Illuminate\Database\Eloquent\Collection ' , $ users );
453453 $ this ->assertInstanceOf ('Jenssegers\Mongodb\Model ' , $ users [0 ]);
454454
455455 $ user = User::raw (function ($ collection )
456456 {
457- return $ collection ->findOne (array ( 'age ' => 35 ) );
457+ return $ collection ->findOne ([ 'age ' => 35 ] );
458458 });
459459 $ this ->assertInstanceOf ('Jenssegers\Mongodb\Model ' , $ user );
460460
@@ -466,20 +466,20 @@ public function testRaw()
466466
467467 $ result = User::raw (function ($ collection )
468468 {
469- return $ collection ->insert (array ( 'name ' => 'Yvonne Yoe ' , 'age ' => 35 ) );
469+ return $ collection ->insert ([ 'name ' => 'Yvonne Yoe ' , 'age ' => 35 ] );
470470 });
471471 $ this ->assertTrue (is_array ($ result ));
472472 }
473473
474474 public function testDotNotation ()
475475 {
476- $ user = User::create (array (
476+ $ user = User::create ([
477477 'name ' => 'John Doe ' ,
478478 'address ' => [
479479 'city ' => 'Paris ' ,
480480 'country ' => 'France ' ,
481481 ]
482- ) );
482+ ] );
483483
484484 $ this ->assertEquals ('Paris ' , $ user ->getAttribute ('address.city ' ));
485485 $ this ->assertEquals ('Paris ' , $ user ['address.city ' ]);
0 commit comments