File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -31,15 +31,22 @@ protected function setUp(): void
3131 }
3232
3333 /**
34- * Set up Log facade mocking to handle both explicit expectations and channel() calls.
35- * Call this at the beginning of tests that need to mock Log methods .
34+ * Set up Log facade mocking to handle Laravel infrastructure calls without
35+ * interfering with explicit test expectations for application logging .
3636 */
3737 protected function setupLogMocking (): void
3838 {
39- // Allow channel() calls that may happen during Carbon/exception handling
39+ // Only mock the methods that Laravel's infrastructure may call in background
40+ // during exception/deprecation handling, class loading, etc.
41+ // These are NOT the methods we want to test explicitly in our application code
4042 Log::shouldReceive ('channel ' )
4143 ->andReturnSelf ()
4244 ->byDefault ();
45+
46+ // Laravel's HandleExceptions calls warning() for deprecation notices
47+ Log::shouldReceive ('warning ' )
48+ ->andReturnSelf ()
49+ ->byDefault ();
4350 }
4451
4552 /**
You can’t perform that action at this time.
0 commit comments