@@ -821,7 +821,7 @@ public function testUpdateProcess()
821821 $ query ->shouldReceive ('update ' )->once ()->with (['name ' => 'taylor ' ])->andReturn (1 );
822822 $ model ->expects ($ this ->once ())->method ('newModelQuery ' )->willReturn ($ query );
823823 $ model ->expects ($ this ->once ())->method ('updateTimestamps ' );
824- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
824+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
825825 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.saving: ' .get_class ($ model ), $ model )->andReturn (true );
826826 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.updating: ' .get_class ($ model ), $ model )->andReturn (true );
827827 $ events ->shouldReceive ('dispatch ' )->once ()->with ('eloquent.updated: ' .get_class ($ model ), $ model )->andReturn (true );
@@ -843,7 +843,7 @@ public function testUpdateProcessDoesntOverrideTimestamps()
843843 $ query ->shouldReceive ('where ' )->once ()->with ('id ' , '= ' , 1 );
844844 $ query ->shouldReceive ('update ' )->once ()->with (['created_at ' => 'foo ' , 'updated_at ' => 'bar ' ])->andReturn (1 );
845845 $ model ->expects ($ this ->once ())->method ('newModelQuery ' )->willReturn ($ query );
846- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
846+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
847847 $ events ->shouldReceive ('until ' );
848848 $ events ->shouldReceive ('dispatch ' );
849849
@@ -860,7 +860,7 @@ public function testSaveIsCanceledIfSavingEventReturnsFalse()
860860 $ model = $ this ->getMockBuilder (EloquentModelStub::class)->onlyMethods (['newModelQuery ' ])->getMock ();
861861 $ query = m::mock (Builder::class);
862862 $ model ->expects ($ this ->once ())->method ('newModelQuery ' )->willReturn ($ query );
863- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
863+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
864864 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.saving: ' .get_class ($ model ), $ model )->andReturn (false );
865865 $ model ->exists = true ;
866866
@@ -872,7 +872,7 @@ public function testUpdateIsCanceledIfUpdatingEventReturnsFalse()
872872 $ model = $ this ->getMockBuilder (EloquentModelStub::class)->onlyMethods (['newModelQuery ' ])->getMock ();
873873 $ query = m::mock (Builder::class);
874874 $ model ->expects ($ this ->once ())->method ('newModelQuery ' )->willReturn ($ query );
875- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
875+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
876876 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.saving: ' .get_class ($ model ), $ model )->andReturn (true );
877877 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.updating: ' .get_class ($ model ), $ model )->andReturn (false );
878878 $ model ->exists = true ;
@@ -886,7 +886,7 @@ public function testEventsCanBeFiredWithCustomEventObjects()
886886 $ model = $ this ->getMockBuilder (EloquentModelEventObjectStub::class)->onlyMethods (['newModelQuery ' ])->getMock ();
887887 $ query = m::mock (Builder::class);
888888 $ model ->expects ($ this ->once ())->method ('newModelQuery ' )->willReturn ($ query );
889- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
889+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
890890 $ events ->shouldReceive ('until ' )->once ()->with (m::type (EloquentModelSavingEventStub::class))->andReturn (false );
891891 $ model ->exists = true ;
892892
@@ -919,7 +919,7 @@ public function testUpdateUsesOldPrimaryKey()
919919 $ query ->shouldReceive ('update ' )->once ()->with (['id ' => 2 , 'foo ' => 'bar ' ])->andReturn (1 );
920920 $ model ->expects ($ this ->once ())->method ('newModelQuery ' )->willReturn ($ query );
921921 $ model ->expects ($ this ->once ())->method ('updateTimestamps ' );
922- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
922+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
923923 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.saving: ' .get_class ($ model ), $ model )->andReturn (true );
924924 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.updating: ' .get_class ($ model ), $ model )->andReturn (true );
925925 $ events ->shouldReceive ('dispatch ' )->once ()->with ('eloquent.updated: ' .get_class ($ model ), $ model )->andReturn (true );
@@ -1065,7 +1065,7 @@ public function testInsertProcess()
10651065 $ model ->expects ($ this ->once ())->method ('newModelQuery ' )->willReturn ($ query );
10661066 $ model ->expects ($ this ->once ())->method ('updateTimestamps ' );
10671067
1068- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
1068+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
10691069 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.saving: ' .get_class ($ model ), $ model )->andReturn (true );
10701070 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.creating: ' .get_class ($ model ), $ model )->andReturn (true );
10711071 $ events ->shouldReceive ('dispatch ' )->once ()->with ('eloquent.created: ' .get_class ($ model ), $ model );
@@ -1085,7 +1085,7 @@ public function testInsertProcess()
10851085 $ model ->expects ($ this ->once ())->method ('updateTimestamps ' );
10861086 $ model ->setIncrementing (false );
10871087
1088- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
1088+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
10891089 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.saving: ' .get_class ($ model ), $ model )->andReturn (true );
10901090 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.creating: ' .get_class ($ model ), $ model )->andReturn (true );
10911091 $ events ->shouldReceive ('dispatch ' )->once ()->with ('eloquent.created: ' .get_class ($ model ), $ model );
@@ -1104,7 +1104,7 @@ public function testInsertIsCanceledIfCreatingEventReturnsFalse()
11041104 $ query = m::mock (Builder::class);
11051105 $ query ->shouldReceive ('getConnection ' )->once ();
11061106 $ model ->expects ($ this ->once ())->method ('newModelQuery ' )->willReturn ($ query );
1107- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
1107+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
11081108 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.saving: ' .get_class ($ model ), $ model )->andReturn (true );
11091109 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.creating: ' .get_class ($ model ), $ model )->andReturn (false );
11101110
@@ -1123,7 +1123,7 @@ public function testInsertOrIgnoreProcessWithIncrementing()
11231123 $ model ->expects ($ this ->once ())->method ('newModelQuery ' )->willReturn ($ query );
11241124 $ model ->expects ($ this ->once ())->method ('updateTimestamps ' );
11251125
1126- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
1126+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
11271127 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.saving: ' .get_class ($ model ), $ model )->andReturn (true );
11281128 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.creating: ' .get_class ($ model ), $ model )->andReturn (true );
11291129 $ events ->shouldReceive ('dispatch ' )->once ()->with ('eloquent.created: ' .get_class ($ model ), $ model );
@@ -1148,7 +1148,7 @@ public function testInsertOrIgnoreProcessWithConflict()
11481148 $ model ->expects ($ this ->once ())->method ('newModelQuery ' )->willReturn ($ query );
11491149 $ model ->expects ($ this ->once ())->method ('updateTimestamps ' );
11501150
1151- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
1151+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
11521152 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.saving: ' .get_class ($ model ), $ model )->andReturn (true );
11531153 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.creating: ' .get_class ($ model ), $ model )->andReturn (true );
11541154
@@ -1171,7 +1171,7 @@ public function testInsertOrIgnoreProcessWithNonIncrementing()
11711171 $ model ->expects ($ this ->once ())->method ('updateTimestamps ' );
11721172 $ model ->setIncrementing (false );
11731173
1174- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
1174+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
11751175 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.saving: ' .get_class ($ model ), $ model )->andReturn (true );
11761176 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.creating: ' .get_class ($ model ), $ model )->andReturn (true );
11771177 $ events ->shouldReceive ('dispatch ' )->once ()->with ('eloquent.created: ' .get_class ($ model ), $ model );
@@ -1196,7 +1196,7 @@ public function testInsertOrIgnoreProcessWithNamedUnique()
11961196 $ model ->expects ($ this ->once ())->method ('newModelQuery ' )->willReturn ($ query );
11971197 $ model ->expects ($ this ->once ())->method ('updateTimestamps ' );
11981198
1199- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
1199+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
12001200 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.saving: ' .get_class ($ model ), $ model )->andReturn (true );
12011201 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.creating: ' .get_class ($ model ), $ model )->andReturn (true );
12021202
@@ -2638,7 +2638,7 @@ public function testReplicatingEventIsFiredWhenReplicatingModel()
26382638 {
26392639 $ model = new EloquentModelStub ;
26402640
2641- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
2641+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
26422642 $ events ->shouldReceive ('dispatch ' )->once ()->with ('eloquent.replicating: ' .get_class ($ model ), m::on (function ($ m ) use ($ model ) {
26432643 return $ model ->is ($ m );
26442644 }));
@@ -2655,7 +2655,7 @@ public function testReplicateQuietlyCreatesANewModelInstanceWithSameAttributeVal
26552655 $ model ->updated_at = new DateTime ;
26562656 $ replicated = $ model ->replicateQuietly ();
26572657
2658- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
2658+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
26592659 $ events ->shouldReceive ('dispatch ' )->never ()->with ('eloquent.replicating: ' .get_class ($ model ), $ model )->andReturn (true );
26602660
26612661 $ this ->assertNull ($ replicated ->id );
@@ -2698,7 +2698,7 @@ public function testIncrementQuietlyOnExistingModelCallsQueryAndSetsAttributeAnd
26982698 $ query ->shouldReceive ('where ' )->andReturn ($ query );
26992699 $ query ->shouldReceive ('increment ' );
27002700
2701- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
2701+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
27022702 $ events ->shouldReceive ('until ' )->never ()->with ('eloquent.saving: ' .get_class ($ model ), $ model )->andReturn (true );
27032703 $ events ->shouldReceive ('until ' )->never ()->with ('eloquent.updating: ' .get_class ($ model ), $ model )->andReturn (true );
27042704 $ events ->shouldReceive ('dispatch ' )->never ()->with ('eloquent.updated: ' .get_class ($ model ), $ model )->andReturn (true );
@@ -2725,7 +2725,7 @@ public function testDecrementQuietlyOnExistingModelCallsQueryAndSetsAttributeAnd
27252725 $ query ->shouldReceive ('where ' )->andReturn ($ query );
27262726 $ query ->shouldReceive ('decrement ' );
27272727
2728- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
2728+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
27292729 $ events ->shouldReceive ('until ' )->never ()->with ('eloquent.saving: ' .get_class ($ model ), $ model )->andReturn (true );
27302730 $ events ->shouldReceive ('until ' )->never ()->with ('eloquent.updating: ' .get_class ($ model ), $ model )->andReturn (true );
27312731 $ events ->shouldReceive ('dispatch ' )->never ()->with ('eloquent.updated: ' .get_class ($ model ), $ model )->andReturn (true );
@@ -2811,7 +2811,7 @@ public function testIncrementEachFiresModelEvents()
28112811 $ query ->shouldReceive ('where ' )->andReturn ($ query );
28122812 $ query ->shouldReceive ('incrementEach ' )->andReturn (1 );
28132813
2814- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
2814+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
28152815 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.updating: ' .get_class ($ model ), $ model )->andReturn (true );
28162816 $ events ->shouldReceive ('dispatch ' )->once ()->with ('eloquent.updated: ' .get_class ($ model ), $ model );
28172817
@@ -2828,7 +2828,7 @@ public function testIncrementEachReturnsFalseWhenUpdatingEventCancelled()
28282828
28292829 $ model ->shouldReceive ('newQueryWithoutScopes ' )->never ();
28302830
2831- $ model-> setEventDispatcher ($ events = m::mock (Dispatcher::class));
2831+ $ model:: setEventDispatcher ($ events = m::mock (Dispatcher::class));
28322832 $ events ->shouldReceive ('until ' )->once ()->with ('eloquent.updating: ' .get_class ($ model ), $ model )->andReturn (false );
28332833
28342834 $ result = $ model ->publicIncrementEach (['foo ' => 1 ]);
0 commit comments