PHP code example of phpjuice / pest-plugin-vcr

1. Go to this page and download the library: Download phpjuice/pest-plugin-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/ */

    

phpjuice / pest-plugin-vcr example snippets


use VCR\VCR;


VCR::configure()->setCassettePath(__DIR__.'/cassettes');

it('records requests to pestphp.com', function () {

    vcrTurnOn('pestphp.com');

    $result = file_get_contents('https://pestphp.com/');

    expect($result)
        ->toBe('Hello from pestphp.');

    vcrTurnOff();
});