Skip to content

Commit

Permalink
use method name to eliminate method not found warnings (#3)
Browse files Browse the repository at this point in the history
Co-authored-by: Ivan Li <[email protected]>
  • Loading branch information
ivancli and Ivan Li authored Aug 1, 2024
1 parent 4e0457a commit 3b446d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 2 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
6 changes: 5 additions & 1 deletion src/Subscribers/OnTestPrepared.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3b446d5

Please sign in to comment.