1. Go to this page and download the library: Download adgoal/aspect-mock 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/ */
xml
<phpunit bootstrap="bootstrap.php" backupGlobals="false">
php
use AspectMock\Test as test;
class UserTest extends \PHPUnit_Framework_TestCase
{
protected function tearDown()
{
test::clean(); // remove all registered test doubles
}
public function testDoubleClass()
{
$user = test::double('demo\UserModel', ['save' => null]);
\demo\UserModel::tableName();
\demo\UserModel::tableName();
$user->verifyInvokedMultipleTimes('tableName',2);
}
php
namespace Codeception\Module;
class CodeHelper extends \Codeception\Module
{
function _after(\Codeception\TestCase $test)
{
\AspectMock\Test::clean();
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.