Closed komandakycto closed 5 years ago
\Codeception\Configuration::config()
runs self::loadSuites();
right before return $config;
In s3.php in __c3_factory() function run \Codeception\Configuration::config()
and load global config. In config() function execute only first lines:
if (!$configFile && self::$config) {
return self::$config;
}
In vendor/codeception/base/src/Codeception/Configuration.php self::loadSuites()
calls in the end of config()
method. How self::$suites
should be fill if config()
method return self::config
in the first lines of config()
method?
It returns cached result if config
method is called multiple times.
The only way to get config without suites is if you include
setting is present and paths: tests:
is missing in codeception.yml.
https://github.com/Codeception/base/blob/2.2.3/src/Codeception/Configuration.php#L183-L184
Which is quite likely with your directory structure.
Thanks, it was cause of exception like "Suite api was not loaded". But after fix, I catch another error =)
I try run coverage count by command:
And nothing work. I see in Response error: Notice: Undefined variable: settings in /var/www/html/c3.php on line 249 If I parse Exception on 241 line I see message: "Suite api was not loaded" because
self::suites
is empty in vendor/codeception/base/src/Codeception/Configuration.php:307.When s3.php run
\Codeception\Configuration::suiteSettings($suite, \Codeception\Configuration::config())
without configuration file we see thatconfig
method returnself::$config
and don't runself::loadSuites();
below. It is cause why I see that my suit was not loaded.My composer versions:, "codeception/base": "^2.2.3", "codeception/verify": "~0.3.1", "phpunit/phpunit": "5.7.27", "codeception/c3": "2.*"
My project structure -root ---api ----tests ------api/ ------functional/ ------unit/ ------api.suite.yml ------functional.suite.yml ------unit.suite.yml ----codeception.yml --backend/ --common/ -codeception.yml