File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
tests/Integration/Database Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 66use Illuminate \Database \Eloquent \Model ;
77use Illuminate \Database \LazyLoadingViolationException ;
88use Illuminate \Database \Schema \Blueprint ;
9+ use Illuminate \Support \Facades \Event ;
910use Illuminate \Support \Facades \Schema ;
1011
1112/**
@@ -115,7 +116,7 @@ public function testStrictModeThrowsAnExceptionOnLazyLoadingInRelations()
115116
116117 public function testStrictModeWithCustomCallbackOnLazyLoading ()
117118 {
118- $ this -> expectsEvents (ViolatedLazyLoadingEvent::class );
119+ Event:: fake ( );
119120
120121 Model::handleLazyLoadingViolationUsing (function ($ model , $ key ) {
121122 event (new ViolatedLazyLoadingEvent ($ model , $ key ));
@@ -127,6 +128,8 @@ public function testStrictModeWithCustomCallbackOnLazyLoading()
127128 $ models = EloquentStrictLoadingTestModel1::get ();
128129
129130 $ models [0 ]->modelTwos ;
131+
132+ Event::assertDispatched (ViolatedLazyLoadingEvent::class);
130133 }
131134
132135 public function testStrictModeWithOverriddenHandlerOnLazyLoading ()
You can’t perform that action at this time.
0 commit comments