PHP code example of raigu / psr14-event-dispatcher-spy

1. Go to this page and download the library: Download raigu/psr14-event-dispatcher-spy 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/ */

    

raigu / psr14-event-dispatcher-spy example snippets


$spy = new \Raigu\TestDouble\Psr14\EventDispatcherSpy();

$sut = new \Foo\Bar($spy);
$sut->bar();

assert($spy->dispatched(\Foo\BarEvent::class));