File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 22
33namespace Spatie \Permission \Tests ;
44
5+ use Illuminate \Database \Eloquent \Model ;
56use DB ;
67use Spatie \Permission \Contracts \Permission ;
78use Spatie \Permission \Contracts \Role ;
@@ -769,6 +770,8 @@ public function it_can_reject_permission_based_on_logged_in_user_guard()
769770 /** @test */
770771 public function it_can_be_given_a_permission_on_role_when_lazy_loading_is_restricted ()
771772 {
773+ $ this ->assertTrue (Model::preventsLazyLoading ());
774+
772775 try {
773776 $ testRole = app (Role::class)->with ('permissions ' )->get ()->first ();
774777
@@ -783,6 +786,8 @@ public function it_can_be_given_a_permission_on_role_when_lazy_loading_is_restri
783786 /** @test */
784787 public function it_can_be_given_a_permission_on_user_when_lazy_loading_is_restricted ()
785788 {
789+ $ this ->assertTrue (Model::preventsLazyLoading ());
790+
786791 try {
787792 User::
create ([
'email ' =>
'[email protected] ' ]);
788793 $ testUser = User::with ('permissions ' )->get ()->first ();
Original file line number Diff line number Diff line change 22
33namespace Spatie \Permission \Tests ;
44
5+ use Illuminate \Database \Eloquent \Model ;
56use Illuminate \Support \Facades \DB ;
67use Spatie \Permission \Contracts \Permission ;
78use Spatie \Permission \Contracts \Role ;
@@ -861,6 +862,8 @@ public function it_does_not_detach_roles_when_user_soft_deleting()
861862 /** @test */
862863 public function it_can_be_given_a_role_on_permission_when_lazy_loading_is_restricted ()
863864 {
865+ $ this ->assertTrue (Model::preventsLazyLoading ());
866+
864867 try {
865868 $ testPermission = app (Permission::class)->with ('roles ' )->get ()->first ();
866869
@@ -875,6 +878,8 @@ public function it_can_be_given_a_role_on_permission_when_lazy_loading_is_restri
875878 /** @test */
876879 public function it_can_be_given_a_role_on_user_when_lazy_loading_is_restricted ()
877880 {
881+ $ this ->assertTrue (Model::preventsLazyLoading ());
882+
878883 try {
879884 User::
create ([
'email ' =>
'[email protected] ' ]);
880885 $ user = User::with ('roles ' )->get ()->first ();
You can’t perform that action at this time.
0 commit comments