@@ -213,10 +213,10 @@ public function testGroupBy(): void
213
213
{
214
214
// begin query groupBy
215
215
$ result = DB ::table ('movies ' )
216
- ->where ('rated ' , 'G ' )
217
- ->groupBy ('runtime ' )
218
- ->orderBy ('runtime ' , 'asc ' )
219
- ->get (['title ' ]);
216
+ ->where ('rated ' , 'G ' )
217
+ ->groupBy ('runtime ' )
218
+ ->orderBy ('runtime ' , 'asc ' )
219
+ ->get (['title ' ]);
220
220
// end query groupBy
221
221
222
222
$ this ->assertInstanceOf (\Illuminate \Support \Collection::class, $ result );
@@ -420,10 +420,10 @@ public function testWhereRaw(): void
420
420
// begin query raw
421
421
$ result = DB ::table ('movies ' )
422
422
->whereRaw ([
423
- 'imdb.votes ' => ['$gte ' => 1000 ],
423
+ 'imdb.votes ' => ['$gte ' => 1000 ],
424
424
'$or ' => [
425
425
['imdb.rating ' => ['$gt ' => 7 ]],
426
- ['directors ' => ['$in ' => [ 'Yasujiro Ozu ' , 'Sofia Coppola ' , 'Federico Fellini ' ]]],
426
+ ['directors ' => ['$in ' => ['Yasujiro Ozu ' , 'Sofia Coppola ' , 'Federico Fellini ' ]]],
427
427
],
428
428
])->get ();
429
429
// end query raw
@@ -470,7 +470,7 @@ public function testNear(): void
470
470
{
471
471
$ this ->importTheaters ();
472
472
473
- // begin query near
473
+ // begin query near
474
474
$ results = DB ::table ('theaters ' )
475
475
->where ('location.geo ' , 'near ' , [
476
476
'$geometry ' => [
@@ -588,7 +588,7 @@ public function testUpdateUpsert(): void
588
588
[
589
589
'plot ' => 'An autobiographical movie ' ,
590
590
'year ' => 1998 ,
591
- 'writers ' => [ 'Will Hunting ' ],
591
+ 'writers ' => ['Will Hunting ' ],
592
592
],
593
593
['upsert ' => true ],
594
594
);
@@ -597,6 +597,26 @@ public function testUpdateUpsert(): void
597
597
$ this ->assertIsInt ($ result );
598
598
}
599
599
600
+ public function testMultiplyDivide (): void
601
+ {
602
+ // begin multiply divide
603
+ $ result = DB ::table ('movies ' )
604
+ ->where ('year ' , 2001 )
605
+ ->multiply ('imdb.votes ' , 5 )
606
+ ->divide ('runtime ' , 2 );
607
+ // end multiply divide
608
+
609
+ $ this ->assertIsInt ($ result );
610
+
611
+ // begin multiply with set
612
+ $ result = DB ::table ('movies ' )
613
+ ->where ('year ' , 1958 )
614
+ ->multiply ('runtime ' , 1.5 , ['note ' => 'Adds recovered footage & interviews. ' ]);
615
+ // end multiply with set
616
+
617
+ $ this ->assertIsInt ($ result );
618
+ }
619
+
600
620
public function testIncrement (): void
601
621
{
602
622
// begin increment
0 commit comments