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

21 lines
413 B
PHP

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