File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 44use Binafy \LaravelUserMonitoring \Utills \ActionType ;
55use Binafy \LaravelUserMonitoring \Utills \UserUtils ;
66use Illuminate \Foundation \Testing \RefreshDatabase ;
7+ use Illuminate \Http \Request ;
78use Illuminate \Support \Facades \DB ;
89use Tests \SetUp \Models \Product ;
910use Tests \SetUp \Models \ProductSoftDelete ;
361362 // DB Assertions
362363 assertDatabaseCount (config ('user-monitoring.action_monitoring.table ' ), 2 );
363364});
365+
366+ test ('action is stored when config conditions are true ' , function () {
367+ config ()->set ('user-monitoring.action_monitoring.conditions ' , [
368+ function (Request $ request ) {
369+ return true ;
370+ },
371+ ]);
372+
373+ Product::query ()->create ([
374+ 'title ' => 'milwad ' ,
375+ 'description ' => 'WE ARE HELPING TO OPEN-SOURCE WORLD '
376+ ]);
377+
378+ // DB Assertions
379+ assertDatabaseCount (config ('user-monitoring.action_monitoring.table ' ), 1 );
380+ });
You can’t perform that action at this time.
0 commit comments