Skip to content

Commit 02d0a80

Browse files
committed
add action is not stored when config conditions are false test
1 parent 2b5c9f8 commit 02d0a80

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/Feature/ActionMonitoringTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,3 +378,19 @@ function (Request $request) {
378378
// DB Assertions
379379
assertDatabaseCount(config('user-monitoring.action_monitoring.table'), 1);
380380
});
381+
382+
test('action is not stored when config conditions are false', function () {
383+
config()->set('user-monitoring.action_monitoring.conditions', [
384+
function (Request $request) {
385+
return false;
386+
},
387+
]);
388+
389+
Product::query()->create([
390+
'title' => 'milwad',
391+
'description' => 'WE ARE HELPING TO OPEN-SOURCE WORLD'
392+
]);
393+
394+
// DB Assertions
395+
assertDatabaseCount(config('user-monitoring.action_monitoring.table'), 0);
396+
});

0 commit comments

Comments
 (0)