We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 )
The text was updated successfully, but these errors were encountered:
appDir should contain the path to your application, not aspect mock's source
appDir
Sorry, something went wrong.
Hello, I have the same problem: codeception version: 3.1.2 codecept version: 3.1.0 framework: Codeigniter 2 (a legacy app)
_bootstrap file: `include DIR.'/../vendor/autoload.php';
$kernel = \AspectMock\Kernel::getInstance(); $kernel->init([ 'debug' => true, 'includePaths' => [__DIR__.'/../application'], 'appDir' => __DIR__.'/../application', 'cacheDir' => '/tmp', 'excludePaths' => [__DIR__, __DIR__.'/../system',] ]);
$kernel = \AspectMock\Kernel::getInstance();
$kernel->init([
'debug' => true,
'includePaths' => [__DIR__.'/../application'],
'appDir' => __DIR__.'/../application',
'cacheDir' => '/tmp',
'excludePaths' => [__DIR__, __DIR__.'/../system',]
]);
codeception.yml: unit: actor: Unit path: ./unit modules: enabled: - \Helper\Unit - Asserts bootstrap: '../_bootstrap.php'
unit:
actor: Unit
path: ./unit
modules:
enabled:
- \Helper\Unit
- Asserts
bootstrap: '../_bootstrap.php'
class = application/A.php class A { public function aa() { return 'aa'; } public static function bb() { return 'bb'; } }
application/A.php
class A
{
public function aa() {
return 'aa';
}
public static function bb() {
return 'bb';
test: test::double(A::class, [ 'aa' => 'cc', 'bb' => 'dd', ]); $c = new A(); $r = $c->aa(); $r2 = $c::bb();
test::double(A::class, [
'aa' => 'cc',
'bb' => 'dd',
$c = new A();
$r = $c->aa();
$r2 = $c::bb();
`$this->assertEquals('cc', $r);` `$this->assertEquals('dd', $r2);`
results:
Test tests/unit/Permissions/UserCanTest.php:testMock Failed asserting that two strings are equal. - Expected | + Actual @@ @@ -'cc' +'aa'
Test tests/unit/Permissions/UserCanTest.php:testMock
Failed asserting that two strings are equal.
- Expected | + Actual
@@ @@
-'cc'
+'aa'
No branches or pull requests
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 )
The text was updated successfully, but these errors were encountered: