Codeception: An error was encountered when using a method not found in yii2 framework codeception
When I run the test in the project directory when codecept.phar run unit
, Console gives an error:
Codeception PHP Testing Framework v2.2.2
Powered by PHPUnit 5.4.6 by Sebastian Bergmann and contributors.
Unit Tests (2) -----------------------------------------------------------------------------------------------------------------------------------
- EventTest: Event is auditPHP Fatal error: Call to a member function selectDB() on null in /var/lib/jenkins/workspace/xxx/vendor/yiisoft/yii2-mongodb/Connection.php on line 172
<pre>PHP Fatal Error 'yii\base\ErrorException' with message 'Call to a member function selectDB() on null'
in /var/lib/jenkins/workspace/xxx/vendor/yiisoft/yii2-mongodb/Connection.php:172
Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleFatalError()
#1 {main}</pre>
Connection.php on line 172 content: 'mongoDb' => $this->mongoClient->selectDB($name)
select DB is mongodb extend MongoClient class method, wondering why can not find a test run from the inside of the extension method.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 19 (2 by maintainers)
Commits related to this issue
- Yii2 module improvements (#3343) Improved Yii2 module: * init part added to work with unit/acceptance tests * added entryScript and entryUrl config values * added amOnRoute method * added amlog... — committed to Codeception/Codeception by DavertMik 8 years ago
- Fixes #3332: Fixed regression in Yii 2 connector not allowing to work with output of error pages in functional tests — committed to Codeception/Codeception by samdark 8 years ago
This problem can solve some priority, waiting for the actual project write unit tests, progress is now stuck in here.