diff --git a/tests/InvokableBehaviorFakeTest.php b/tests/InvokableBehaviorFakeTest.php index e2508c6..14762c9 100644 --- a/tests/InvokableBehaviorFakeTest.php +++ b/tests/InvokableBehaviorFakeTest.php @@ -320,4 +320,18 @@ public function __invoke(ContextManager $context): bool TestCountGuard::shouldRun()->never(); TestCountGuard::assertNotRan(); }); +it('maintains behavior isolation after resetting all fakes', function (): void { + // 1. Arrange + TestIncrementAction::shouldRun()->once(); + TestCountGuard::shouldRun()->twice(); + EventMachine::resetAllFakes(); + + // 2. Act + TestIncrementAction::shouldRun()->once(); + TestIncrementAction::run(new ContextManager(['count' => 0])); + + // 3. Assert + TestIncrementAction::assertRan(); + expect(TestCountGuard::isFaked())->toBeFalse(); +}); // endregion