Need help: could we use Codeception-MultiDb with unit tests?
kuflievskiy opened this issue · 2 comments
I am not sure if I do something wrong, but I receive this error :
[Codeception\Exception\ConfigurationException]
Module Codeception\Extension\MultiDb could not be found and loaded
I am using "redmatter/codeception-multidb" for acceptance tests and it works like a charm.
composer.json
{
"require": {
"codeception/codeception": "^2.2",
"phpunit/phpunit": ">4.8.20 <6.0",
"redmatter/codeception-multidb": "~2.0@dev",
"flow/jsonpath":"0.3.4",
"guzzle/guzzle": "~3.7"
}
}
unit.suite.yml :
# Codeception Test Suite Configuration
#
# Suite for unit (internal) tests.
class_name: UnitTester
modules:
enabled:
- Asserts
- \Helper\Unit
- Codeception\Extension\MultiDb
config:
Codeception\Extension\MultiDb:
timezone: "+00:00"
connectors:
Primary:
dsn: "mysql:host=localhost;port=3306;dbname=xxxxxx"
user: 'xxxxxx'
password: 'xxxxxxx'
When try to execute unit tests in console, I see this :
php codecept.phar run unit --steps
Codeception PHP Testing Framework v2.2.5
Powered by PHPUnit 5.5.5 by Sebastian Bergmann and contributors.
[Codeception\Exception\ConfigurationException]
Module Codeception\Extension\MultiDb could not be found and loaded
Could anyone tell me what I am doing wrong? As I see in example folder, there is example only for acceptance tests.. Thanks for the answer in advance.
Heya Dude,
I'm in the process of migrating to use multidb myself, and bumped into the same/similar issue.
The step I originally missed, was that I needed to do a composer update to pull in the multidb version into the composer.lock file.
composer require redmatter/codeception-multidb 'VERSION NUMBER'
I think I had to actually remove the /vendor folder and then redo a build.
I think I had to actually remove the /vendor folder and then redo a build.
I have tried it without any positive result. Also I tried to run it on previous versions :
{
"require": {
"codeception/codeception": "2.1",
"phpunit/phpunit": "~4.7.0",
"redmatter/codeception-multidb": "~2.0@dev",
"flow/jsonpath":"0.3.4",
"guzzle/guzzle": "~3.7"
}
}
But it also didn't solve the issue.
Currently, as a temporary solution, I use standard Db module. It works perfect.
I will be happy if this extension will support unit testing in future also.