PHP code example of manuglopez / phpunit-replay

1. Go to this page and download the library: Download manuglopez/phpunit-replay 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/ */

    

manuglopez / phpunit-replay example snippets


abstract class TestCase extends \PHPUnit\Framework\TestCase
{
    use \Manuglopez\Replay\PHPUnit\Replayable;

    protected function setUp(): void
    {
        parent::setUp();

        if ($this->isReplaying()) {
            return; // optional: skip expensive boot work too
        }

        // ...boot the app, RefreshDatabase, etc.
    }
}



return [
    'remote' => null,             // 'file:///mnt/cache' | 'https://…' | '[email protected]:org/project-replay.git'
    'remote_push' => 'objects',   // 'objects' = your own results | 'all' = also baselines (CI) | 'off'
    'default_branch' => null,     // null = autodetect
    'baseline_branches' => [],    // ordered candidates for git-flow, e.g. ['develop', 'master']
    'watch' => [],                // extra glob => test directory mappings
    'never_cache' => [],          // test files that always run for real
];

'remote_push' => 'off',   // the safe default: read the cache, never write to it
bash
$ vendor/bin/phpunit-replay --explain --dry-run
tests/CartTest.php                       ← PhpEdge  src/Pricing.php
tests/PricingTest.php                    ← PhpEdge  src/Pricing.php
Replay  2 test files would run (2 affected, 0 uncached, 0 quarantined), 33 tests would replay
mermaid
flowchart LR
    CT["tests/CartTest.php"] --> C["src/Cart.php"]
    CT --> P["src/Pricing.php"]
    PT["tests/PricingTest.php"] --> P
    HT["tests/HomePageTest.php"] --> V["resources/views/welcome.blade.php"]

    classDef changed stroke-width:4px
    class P changed