Skip to content

Commit 7707960

Browse files
committed
CI Fix
1 parent c854a7c commit 7707960

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/TestCase.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff 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
/**

0 commit comments

Comments
 (0)