forked from php-vcr/phpunit-testlistener-vcr
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to specify file via Vcr attribute (#8)
* Updated to accept vcr attribute * Updated readme usage example
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace VCR\PHPUnit\TestListener\Attributes; | ||
|
||
use Attribute; | ||
|
||
/** | ||
* @immutable | ||
* | ||
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit | ||
*/ | ||
#[Attribute(Attribute::TARGET_METHOD)] | ||
final class Vcr | ||
{ | ||
/** | ||
* @var non-empty-string | ||
*/ | ||
private string $cassette; | ||
|
||
/** | ||
* @param non-empty-string $cassette | ||
*/ | ||
public function __construct(string $cassette) | ||
{ | ||
$this->cassette = $cassette; | ||
} | ||
|
||
/** | ||
* @return non-empty-string | ||
*/ | ||
public function cassette(): string | ||
{ | ||
return $this->cassette; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters