File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 22
33use Binafy \LaravelUserMonitoring \Models \VisitMonitoring ;
44use Illuminate \Foundation \Testing \RefreshDatabase ;
5+ use Illuminate \Http \Request ;
56use Tests \SetUp \Models \User ;
67use function Pest \Laravel \{actingAs , get };
78use function Pest \Laravel \{assertDatabaseCount , assertDatabaseHas , assertDatabaseMissing };
122123 assertDatabaseCount (config ('user-monitoring.visit_monitoring.table ' ), 1 );
123124});
124125
126+ test ('visit monitoring store when config conditions are true ' , function () {
127+ config ()->set ('user-monitoring.visit_monitoring.conditions ' , [
128+ function (Request $ request ) {
129+ return true ;
130+ },
131+ ]);
132+
133+ $ response = get ('/ ' );
134+ $ response ->assertContent ('milwad ' );
135+
136+ // DB Assertions
137+ assertDatabaseCount (config ('user-monitoring.visit_monitoring.table ' ), 1 );
138+ });
139+
125140/**
126141 * Create user and return it.
127142 */
You can’t perform that action at this time.
0 commit comments