Skip to content

Commit 47317bb

Browse files
committed
add visit monitoring is not store when config conditions are false test
1 parent e62adbf commit 47317bb

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/Feature/VisitMonitoringTest.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
assertDatabaseCount(config('user-monitoring.visit_monitoring.table'), 1);
124124
});
125125

126-
test('visit monitoring store when config conditions are true', function () {
126+
test('visit monitoring is store when config conditions are true', function () {
127127
config()->set('user-monitoring.visit_monitoring.conditions', [
128128
function (Request $request) {
129129
return true;
@@ -137,6 +137,20 @@ function (Request $request) {
137137
assertDatabaseCount(config('user-monitoring.visit_monitoring.table'), 1);
138138
});
139139

140+
test('visit monitoring is not store when config conditions are false', function () {
141+
config()->set('user-monitoring.visit_monitoring.conditions', [
142+
function (Request $request) {
143+
return false;
144+
},
145+
]);
146+
147+
$response = get('/');
148+
$response->assertContent('milwad');
149+
150+
// DB Assertions
151+
assertDatabaseCount(config('user-monitoring.visit_monitoring.table'), 0);
152+
});
153+
140154
/**
141155
* Create user and return it.
142156
*/

0 commit comments

Comments
 (0)