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 &#039;yii\base\ErrorException&#039; with message &#039;Call to a member function selectDB() on null&#039;

in /var/lib/jenkins/workspace/xxx/vendor/yiisoft/yii2-mongodb/Connection.php:172

Stack trace:
#0 [internal function]: yii\base\ErrorHandler-&gt;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

Most upvoted comments

This problem can solve some priority, waiting for the actual project write unit tests, progress is now stuck in here.