File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 3434 assertDatabaseHas (config ('user-monitoring.action_monitoring.table ' ), ['page ' => url ('/ ' )]);
3535});
3636
37+ test ('store action monitoring when a model created with login user with unknow guard ' , function () {
38+ config (['user-monitoring.user.guards ' => ['milwad ' ]]);
39+
40+ $ user = createUser ();
41+ auth ()->login ($ user );
42+
43+ Product::query ()->create ([
44+ 'title ' => 'milwad '
45+ ]);
46+
47+ // Assertions
48+ expect (ActionMonitoring::query ()->value ('table_name ' ))
49+ ->toBe ('products ' )
50+ ->and (ActionMonitoring::query ()->value ('action_type ' ))
51+ ->toBe (ActionType::ACTION_STORE )
52+ ->and (ActionMonitoring::first ()->user )
53+ ->toBeNull ();
54+
55+ // DB Assertions
56+ assertDatabaseCount (config ('user-monitoring.action_monitoring.table ' ), 1 );
57+ assertDatabaseHas (config ('user-monitoring.action_monitoring.table ' ), ['page ' => url ('/ ' )]);
58+ });
59+
3760test ('store action monitoring when a model created without login user ' , function () {
3861 Product::query ()->create ([
3962 'title ' => 'milwad '
You can’t perform that action at this time.
0 commit comments