В классе хелпера, в функции создания нового пользователя, хочу использовать методы установленного модуля "Db":
public function createUser()
{
// Добавляем клиента
/**
* @var $dbm Db
*/
$dbm = $this->getModule('Db');
$dbm->_getDbh();
$dbm->haveInDatabase('site_users', [
'name' => $this->customerName,
'solution' => $this->solution,
'locale' => 'en',
'active' => '1',
]);
При запуске теста в _before которого вызывается эта функция получаю ошибку:
[Error] Call to a member function hasModule() on null
/home/shishmish/Work/gc/vendor/codeception/codeception/src/Codeception/Module.php:312
/home/shishmish/Work/gc/vendor/codeception/codeception/src/Codeception/Module.php:339
/home/shishmish/Work/gc/tests/_support/Helper/Universal.php:64
/home/shishmish/Work/gc/vendor/codeception/codeception/src/Codeception/Step.php:266
/home/shishmish/Work/gc/vendor/codeception/codeception/src/Codeception/Scenario.php:76
/home/shishmish/Work/gc/tests/_support/_generated/ApiTesterActions.php:4479
/home/shishmish/Work/gc/tests/api/TokenCest.php:23
/home/shishmish/Work/gc/vendor/codeception/codeception/src/Codeception/Lib/Di.php:127
/home/shishmish/Work/gc/vendor/codeception/codeception/src/Codeception/Test/Cest.php:138
/home/shishmish/Work/gc/vendor/codeception/codeception/src/Codeception/Test/Cest.php:97
/home/shishmish/Work/gc/vendor/codeception/codeception/src/Codeception/Test/Cest.php:80
/home/shishmish/Work/gc/vendor/codeception/codeception/src/Codeception/Test/Test.php:88
/home/shishmish/Work/gc/vendor/phpunit/phpunit/src/Framework/TestSuite.php:755
/home/shishmish/Work/gc/vendor/codeception/phpunit-wrapper/src/Runner.php:110
/home/shishmish/Work/gc/vendor/codeception/codeception/src/Codeception/SuiteManager.php:161
/home/shishmish/Work/gc/vendor/codeception/codeception/src/Codeception/Codecept.php:196
/home/shishmish/Work/gc/vendor/codeception/codeception/src/Codeception/Codecept.php:163
/home/shishmish/Work/gc/vendor/codeception/codeception/src/Codeception/Command/Run.php:391
/home/shishmish/Work/gc/vendor/symfony/console/Command/Command.php:255
/home/shishmish/Work/gc/vendor/symfony/console/Application.php:987
/home/shishmish/Work/gc/vendor/symfony/console/Application.php:255
/home/shishmish/Work/gc/vendor/symfony/console/Application.php:148
/home/shishmish/Work/gc/vendor/codeception/codeception/src/Codeception/Application.php:117
/home/shishmish/Work/gc/vendor/codeception/codeception/app.php:46
/home/shishmish/Work/gc/vendor/codeception/codeception/app.php:47
/home/shishmish/Work/gc/vendor/codeception/codeception/codecept:7
Что я делаю не верно? Как правильно использовать getModule?