diff --git a/.gitignore b/.gitignore index 394fb0b3..235a8cff 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ composer.lock /vendor/ coverage.xml .phpunit.result.cache +.phpunit.cache /.php-cs-fixer.php .php-cs-fixer.cache .temp/coverage.php diff --git a/phpunit.xml b/phpunit.xml index b0dc033c..439f1b81 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,16 +1,17 @@ - - - ./tests - - - - - ./src - - + + + ./tests + + + + + ./src + + diff --git a/src/Support/Reflection.php b/src/Support/Reflection.php index 3a0a554a..c4b2572e 100644 --- a/src/Support/Reflection.php +++ b/src/Support/Reflection.php @@ -73,7 +73,7 @@ final class Reflection return $test === null ? static::bindCallable($callable) - : Closure::fromCallable($callable)->bindTo($test)(...$test->getProvidedData()); + : Closure::fromCallable($callable)->bindTo($test)(...$test->providedData()); } /** diff --git a/tests/Features/Covers.php b/tests/Features/Covers.php index 63c3d8a1..fa8b50b8 100644 --- a/tests/Features/Covers.php +++ b/tests/Features/Covers.php @@ -60,13 +60,13 @@ it('guesses if the given argument is a class or function', function () { })->covers(TestCoversClass3::class, 'testCoversFunction'); it('appends CoversNothing to method attributes', function () { - $phpDoc = (new ReflectionClass($this))->getMethod($this->getName()); + $phpDoc = (new ReflectionClass($this))->getMethod($this->name()); expect(str_contains($phpDoc->getDocComment(), '* @coversNothing'))->toBeTrue(); })->coversNothing(); it('does not append CoversNothing to other methods', function () { - $phpDoc = (new ReflectionClass($this))->getMethod($this->getName()); + $phpDoc = (new ReflectionClass($this))->getMethod($this->name()); expect(str_contains($phpDoc->getDocComment(), '* @coversNothing'))->toBeFalse(); }); diff --git a/tests/Features/Helpers.php b/tests/Features/Helpers.php index 0f399fa4..1116f995 100644 --- a/tests/Features/Helpers.php +++ b/tests/Features/Helpers.php @@ -38,8 +38,9 @@ it('allows to call underlying protected/private methods', function () { }); it('throws error if method do not exist', function () { - test()->name(); -})->throws(\ReflectionException::class, 'Call to undefined method PHPUnit\Framework\TestCase::name()'); + $user = new User(); + $user->foo(); +})->throws(Error::class, 'Call to undefined method User::foo()'); it('can forward unexpected calls to any global function')->_assertThat();