mirror of
https://github.com/pestphp/pest.git
synced 2026-03-11 10:17:23 +01:00
fix test and add exception test
This commit is contained in:
@ -5,8 +5,16 @@ use PHPUnit\Framework\TestCase;
|
|||||||
|
|
||||||
uses(Macroable::class);
|
uses(Macroable::class);
|
||||||
|
|
||||||
it('can call chained macro method')->macro('bar', function () {
|
beforeEach(function () {
|
||||||
assertInstanceOf(TestCase::class, $this);
|
$this->macro('bar', function () {
|
||||||
|
assertInstanceOf(TestCase::class, $this);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
})->bar();
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('can call chained macro method')->bar();
|
||||||
|
|
||||||
|
it('will throw exception from call if no macro exists')
|
||||||
|
->throws(BadMethodCallException::class)
|
||||||
|
->foo();
|
||||||
|
|||||||
Reference in New Issue
Block a user