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 2
2
3
3
namespace Spatie \Permission \Tests ;
4
4
5
+ use Illuminate \Database \Eloquent \Model ;
5
6
use DB ;
6
7
use Spatie \Permission \Contracts \Permission ;
7
8
use Spatie \Permission \Contracts \Role ;
@@ -769,6 +770,8 @@ public function it_can_reject_permission_based_on_logged_in_user_guard()
769
770
/** @test */
770
771
public function it_can_be_given_a_permission_on_role_when_lazy_loading_is_restricted ()
771
772
{
773
+ $ this ->assertTrue (Model::preventsLazyLoading ());
774
+
772
775
try {
773
776
$ testRole = app (Role::class)->with ('permissions ' )->get ()->first ();
774
777
@@ -783,6 +786,8 @@ public function it_can_be_given_a_permission_on_role_when_lazy_loading_is_restri
783
786
/** @test */
784
787
public function it_can_be_given_a_permission_on_user_when_lazy_loading_is_restricted ()
785
788
{
789
+ $ this ->assertTrue (Model::preventsLazyLoading ());
790
+
786
791
try {
787
792
User::
create ([
'email ' =>
'[email protected] ' ]);
788
793
$ testUser = User::with ('permissions ' )->get ()->first ();
Original file line number Diff line number Diff line change 2
2
3
3
namespace Spatie \Permission \Tests ;
4
4
5
+ use Illuminate \Database \Eloquent \Model ;
5
6
use Illuminate \Support \Facades \DB ;
6
7
use Spatie \Permission \Contracts \Permission ;
7
8
use Spatie \Permission \Contracts \Role ;
@@ -861,6 +862,8 @@ public function it_does_not_detach_roles_when_user_soft_deleting()
861
862
/** @test */
862
863
public function it_can_be_given_a_role_on_permission_when_lazy_loading_is_restricted ()
863
864
{
865
+ $ this ->assertTrue (Model::preventsLazyLoading ());
866
+
864
867
try {
865
868
$ testPermission = app (Permission::class)->with ('roles ' )->get ()->first ();
866
869
@@ -875,6 +878,8 @@ public function it_can_be_given_a_role_on_permission_when_lazy_loading_is_restri
875
878
/** @test */
876
879
public function it_can_be_given_a_role_on_user_when_lazy_loading_is_restricted ()
877
880
{
881
+ $ this ->assertTrue (Model::preventsLazyLoading ());
882
+
878
883
try {
879
884
User::
create ([
'email ' =>
'[email protected] ' ]);
880
885
$ user = User::with ('roles ' )->get ()->first ();
You can’t perform that action at this time.
0 commit comments