PHP code example of spatie / pest-plugin-snapshots

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

    

spatie / pest-plugin-snapshots example snippets


use function Spatie\Snapshots\{assertMatchesSnapshot, assertMatchesJsonSnapshot};

it('can be cast to string', function () {
    $order = new Order(1);

    assertMatchesSnapshot($order->toString());
});

it('can be cast to json', function () {
    $order = new Order(1);

    assertMatchesJsonSnapshot($order->toJson());
});

it('can be cast to string', function () {
    $order = new Order(1);

    expect($order->toString())->toMatchSnapshot();
});