PHP code example of php-mock / php-mock-prophecy

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

    

php-mock / php-mock-prophecy example snippets


namespace foo;

use phpmock\prophecy\PHPProphet;

$prophet = new PHPProphet();

$prophecy = $prophet->prophesize(__NAMESPACE__);
$prophecy->time()->willReturn(123);
$prophecy->reveal();

assert(123 == time());
$prophet->checkPredictions();
sh
composer