Codeception / Codeception/AspectMock

test::double doesn't work

Open
#168 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
784
Forks
132
PR merge metrics
No merged PRs in 30d

Description

I created this simple test:
`
require_once __DIR__.'/vendor/autoload.php';

$kernel = \AspectMock\Kernel::getInstance();
$kernel->init([
'debug' => true,
'appDir'=>__DIR__."/vendor/codeception/aspect-mock/src/",
'cacheDir' => "/tmp/amock"
]);

class User {
public function getName() {
return "test";
}
};

$user = AspectMock\Test::double(User::class, ['getName' => 'davert']);
$u = new User;
print $u->getName()."\n";
`
It always print "test" instead "davert".
Here is my composer.json file:
"require": {
"php": ">=7.0.0",
"goaop/framework": "^2.2.0",
"symfony/finder": "~2.4|~3.0|~4.0"
},
"require-dev": {
"codeception/base": "^2.4",
"codeception/verify": "~0.2",
"codeception/specify": "~0.3",
"codeception/aspect-mock": "*",
"phpunit/phpunit": "^6.5"
}

PHP 7.0.33-0ubuntu0.16.04.1 (cli) ( NTS )

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.