Files
pest/tests/Features/Macro.php
2020-06-21 18:39:47 +02:00

17 lines
356 B
PHP

<?php
use Illuminate\Support\Traits\Macroable;
use PHPUnit\Framework\TestCase;
uses(Macroable::class);
beforeEach()->macro('bar', function () {
assertInstanceOf(TestCase::class, $this);
});
it('can call chained macro method')->bar();
it('will throw exception from call if no macro exists')
->throws(BadMethodCallException::class)
->foo();