add test for new macro behavior

This commit is contained in:
Tom Witkowski
2020-06-21 14:02:56 +02:00
parent ef5715ce10
commit 53a8c7b05e
2 changed files with 17 additions and 2 deletions

View File

@ -67,6 +67,9 @@
✓ it is a test
✓ it is a higher order message test
PASS Tests\Features\Macro
✓ it can call chained macro method
PASS Tests\Features\Mocks
✓ it has bar
@ -151,5 +154,5 @@
WARN Tests\Visual\Success
s visual snapshot of test suite on success
Tests: 6 skipped, 86 passed
Time: 3.58s
Tests: 6 skipped, 87 passed
Time: 3.60s

12
tests/Features/Macro.php Normal file
View File

@ -0,0 +1,12 @@
<?php
use Illuminate\Support\Traits\Macroable;
use PHPUnit\Framework\TestCase;
uses(Macroable::class);
it('can call chained macro method')->macro('bar', function () {
assertInstanceOf(TestCase::class, $this);
return $this;
})->bar();