We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6e1921 commit 56d12f0Copy full SHA for 56d12f0
1 file changed
tests/MacroableTest.php
@@ -96,3 +96,19 @@ protected function methodThree()
96
$this->TestMacroable::mixin(new $this->TestMixin);
97
$this->assertSame('foo', $instance->methodThree());
98
});
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