Skip to content

Commit

Permalink
Added check on test prepared
Browse files Browse the repository at this point in the history
cg-x committed Oct 1, 2024
1 parent 3d489df commit 49caddb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Subscribers/OnTestPrepared.php
Original file line number Diff line number Diff line change
@@ -50,8 +50,13 @@ public function getCassette(Test $test, string $tag = '@vcr'): ?string
}

$reflection = new \ReflectionMethod($class, $method);
$docblock = $reflection->getDocComment();

$attributes = $reflection->getAttributes(\VCR\PHPUnit\TestListener\Attributes\Vcr::class);
if (!empty($attributes)) {
return $attributes[0]->getArguments()[0];
}

$docblock = $reflection->getDocComment();
if (!empty($docblock)) {
$parsed = self::parseDocBlock($docblock, $tag);
return array_pop($parsed);

0 comments on commit 49caddb

Please sign in to comment.