Skip to content

Commit 56d12f0

Browse files
authored
update tests
1 parent f6e1921 commit 56d12f0

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/MacroableTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,19 @@ protected function methodThree()
9696
$this->TestMacroable::mixin(new $this->TestMixin);
9797
$this->assertSame('foo', $instance->methodThree());
9898
});
99+
100+
test('test flush macros', function (): void {
101+
TestMacroable::macro('flushMethod', function () {
102+
return 'flushMethod';
103+
});
104+
105+
$instance = new TestMacroable;
106+
107+
$this->assertSame('flushMethod', $instance->flushMethod());
108+
109+
TestMacroable::flushMacros();
110+
111+
$this->expectException(BadMethodCallException::class);
112+
113+
$instance->flushMethod();
114+
});

0 commit comments

Comments
 (0)