1. Go to this page and download the library: Download angelov/phpunit-php-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/ */
angelov / phpunit-php-vcr example snippets
use Angelov\PHPUnitPHPVcr\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 Angelov\PHPUnitPHPVcr\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 Angelov\PHPUnitPHPVcr\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 { ... }
}