Skip to content

Commit d824974

Browse files
caseylockerclaude
andcommitted
test(saga): clear resolved facade instances in setUp for test isolation
When SagaCompensationTest runs after tests that bound the real Log facade, Facade::$resolvedInstance still caches the full LogManager. Clear it in setUp so the minimal container bound afterwards is honored. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e2ca6b5 commit d824974

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/Unit/Services/SagaCompensationTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ class SagaCompensationTest extends TestCase
4949
protected function setUp(): void
5050
{
5151
parent::setUp();
52-
// Minimal container so the Log/App facades the code under test touches
53-
// resolve to no-ops. No DB, no full Laravel bootstrap.
52+
// Other tests in the suite may have resolved Log/App facades against a
53+
// full Laravel container; clear that cache so our minimal stub is used.
54+
\Illuminate\Support\Facades\Facade::clearResolvedInstances();
5455
$container = new \Illuminate\Container\Container();
5556
$container->instance('app', $container);
5657
$container->instance('log', new class {

0 commit comments

Comments
 (0)