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 just try to test my Yii App with AspectMock and Codeception. My bootstrap.php:
include __DIR__.'/../vendor/autoload.php'; // composer autoload $kernel = \AspectMock\Kernel::getInstance(); $kernel->init([ 'debug' => true, 'appDir' => __DIR__ . '/..', 'includePaths' => [ __DIR__.'/../src', ], 'cacheDir' => __DIR__ . '/temp/aspectMock', 'excludePaths ' => [__DIR__], ]);
I use it:
\AspectMock\Test::double(\TestForm::class, [ 'validate' => false, ]); $a = new \TestForm(); $a->prop = 123; $I->assertEquals(false, $a->validate()); \AspectMock\Test::double(\TestForm::class, [ 'validate' => true, ]); $a = new \TestForm(); $a->prop = 123; $I->assertEquals(true, $a->validate());
But AspectMock doesn't replace method validate.
I add into bootstap this:
include __DIR__.'/../vendor/autoload.php'; // composer autoload $kernel = \AspectMock\Kernel::getInstance(); $kernel->init([ 'debug' => true, 'appDir' => __DIR__ . '/..', 'includePaths' => [ __DIR__.'/../src', ], 'cacheDir' => __DIR__ . '/temp/aspectMock', 'excludePaths ' => [__DIR__], ]); $kernel->loadFile(__DIR__ . '/../public/protected/models/ConfirmForm.php');
But now I see Error: "Class CFormModel was not found by locator" CFormModel it's parent of my TestForm. And I do this:
$kernel->loadFile(__DIR__ . '/../vendor/yiisoft/yii/framework/base/CComponent.php'); $kernel->loadFile(__DIR__ . '/../vendor/yiisoft/yii/framework/base/CModel.php'); $kernel->loadFile(__DIR__ . '/../vendor/yiisoft/yii/framework/web/CFormModel.php'); $kernel->loadFile(__DIR__ . '/../public/protected/models/ConfirmForm.php');
And I see error "Class CEvent was not found by locator". But class CEvent exists in CComponent.php.
In file CComponent have more then one class. And its a problem, I think.
I cant do anything with it?
Can AspectMock load more then one class from file?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I just try to test my Yii App with AspectMock and Codeception.
My bootstrap.php:
I use it:
But AspectMock doesn't replace method validate.
I add into bootstap this:
But now I see Error: "Class CFormModel was not found by locator"
CFormModel it's parent of my TestForm.
And I do this:
And I see error "Class CEvent was not found by locator". But class CEvent exists in CComponent.php.
In file CComponent have more then one class. And its a problem, I think.
I cant do anything with it?
Can AspectMock load more then one class from file?
The text was updated successfully, but these errors were encountered: