diff --git a/tests/InvokableBehaviorFakeTest.php b/tests/InvokableBehaviorFakeTest.php index 5d5a00b..e2508c6 100644 --- a/tests/InvokableBehaviorFakeTest.php +++ b/tests/InvokableBehaviorFakeTest.php @@ -304,4 +304,20 @@ public function __invoke(ContextManager $context): bool expect(app()->bound(TestIncrementAction::class))->toBeFalse() ->and(app()->bound(TestCountGuard::class))->toBeFalse(); }); + +it('cleans mockery container when resetting fakes', function (): void { + // 1. Arrange + TestIncrementAction::shouldRun()->once(); + TestCountGuard::shouldRun()->twice(); + + // 2. Act + EventMachine::resetAllFakes(); + + // 3. Assert + TestIncrementAction::shouldRun()->never(); + TestIncrementAction::assertNotRan(); + + TestCountGuard::shouldRun()->never(); + TestCountGuard::assertNotRan(); +}); // endregion