File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 66use Illuminate \Foundation \Testing \RefreshDatabase ;
77use Illuminate \Support \Facades \DB ;
88use Tests \SetUp \Models \Product ;
9+ use Tests \SetUp \Models \ProductSoftDelete ;
910use function Pest \Laravel \{assertDatabaseCount , assertDatabaseHas };
1011
1112/*
226227 $ user = createUser ();
227228 auth ()->login ($ user );
228229
229- $ product = \ Tests \ SetUp \ Models \ ProductSoftDelete::query ()->create ([
230+ $ product = ProductSoftDelete::query ()->create ([
230231 'title ' => 'milwad ' ,
231232 'description ' => 'WE ARE HELPING TO OPEN-SOURCE WORLD '
232233 ]);
252253 $ user = createUser ();
253254 auth ()->login ($ user );
254255
255- $ product = \ Tests \ SetUp \ Models \ ProductSoftDelete::query ()->create ([
256+ $ product = ProductSoftDelete::query ()->create ([
256257 'title ' => 'milwad ' ,
257258 'description ' => 'WE ARE HELPING TO OPEN-SOURCE WORLD '
258259 ]);
302303 expect ($ actionMonitoring ->getTypeColor ())->toBe ($ colors [$ type ]);
303304 }
304305});
306+
307+ test ('action not stored when the guest mode is off and user not logged in ' , function () {
308+ config ()->set ('user-monitoring.action_monitoring.guest_mode ' , false );
309+
310+ $ product = Product::query ()->create ([
311+ 'title ' => 'milwad ' ,
312+ 'description ' => 'WE ARE HELPING TO OPEN-SOURCE WORLD '
313+ ]);
314+ $ product ->delete ();
315+
316+ // DB Assertions
317+ assertDatabaseCount (config ('user-monitoring.action_monitoring.table ' ), 0 );
318+ });
You can’t perform that action at this time.
0 commit comments