diff --git a/composer.json b/composer.json index cf44d52..c342158 100644 --- a/composer.json +++ b/composer.json @@ -20,9 +20,7 @@ }, "require": { "covergenius/php-vcr": "^1.7", - "php": "^8.1" - }, - "require-dev": { - "phpunit/phpunit": "^10.1" + "php": "^8.1", + "phpunit/phpunit": "^10.4" } } diff --git a/src/Subscribers/OnTestPrepared.php b/src/Subscribers/OnTestPrepared.php index d53691e..89a3667 100644 --- a/src/Subscribers/OnTestPrepared.php +++ b/src/Subscribers/OnTestPrepared.php @@ -43,7 +43,11 @@ public function getCassette(Test $test, string $tag = '@vcr'): ?string { $reflection = new \ReflectionClass($test); $class = $reflection->getProperty('className')->getValue($test); - $method = $test->name(); + if ($test instanceof Event\Code\TestMethod) { + $method = $test->methodName(); + } else { + $method = $test->name(); + } $reflection = new \ReflectionMethod($class, $method); $docblock = $reflection->getDocComment();