PHP code example of daycry / phpunit-extension-vcr
1. Go to this page and download the library: Download daycry/phpunit-extension-vcr library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
daycry / phpunit-extension-vcr example snippets
use Daycry\PHPUnit\Vcr\Attributes\UseCassette;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
#[UseCassette("example_cassette.yml")]
class ExampleTest extends TestCase
{
#[Test]
public function example(): void { ... }
#[Test]
public function another(): void { ... }
}
use Daycry\PHPUnit\Vcr\Attributes\UseCassette;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
class ExampleTest extends TestCase
{
#[Test]
#[UseCassette("example.yml")]
public function example(): void { ... }
#[Test]
public function another(): void { ... }
#[Test]
#[UseCassette("example_2.yml")]
public function recorded(): void { ... }
}
use Daycry\PHPUnit\Vcr\Attributes\UseCassette;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
#[UseCassette("example.yml")]
class ExampleTest extends TestCase
{
#[Test]
public function example(): void { ... }
#[Test]
#[UseCassette("example_2.yml")]
public function recorded(): void { ... }
}