PHP code example of expectation / peridot-expectation

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

    

expectation / peridot-expectation example snippets


{
    "  "expectation/peridot-expect-plugin": "3.0.0"
    }
}

use expect\peridot\ExpectPlugin;

return function(EventEmitterInterface $emitter) {
    ExpectPlugin::create()->registerTo($emitter);
};

use expect\peridot\ExpectPlugin;

return function(EventEmitterInterface $emitter) {
    ExpectPlugin::createWithConfig('.expect.toml')->registerTo($emitter);
};

describe('Example', function() {
    describe('#create', function() {
        it('return instance', function() {
            expect(Example::create())->toBeAnInstanceOf('Example')
        });
    });
});