1. Go to this page and download the library: Download amorpro/soft-mocks 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/ */
amorpro / soft-mocks example snippets
\QA\SoftMocks::redefineFunction('call_user_func_array', '', 'return 20;');
\QA\SoftMocks::redefineFunction('strlen', '', 'return 5;');
...
strlen('test'); // will return 5
call_user_func_array('strlen', ['test']); // will return 20
call_user_func('strlen', 'test'); // will return 5