Answer the question
In order to leave comments, you need to log in
How to configure _bootstrap for phpunit?
Hello. I can't run unit tests,
it gives me this:
<pre>PHP Fatal Error 'yii\base\ErrorException' with message 'Clas
in F:\Open-server\OpenServer\domains\job.ua\tests\unit\FirstTest.php:13
Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleFatalError()
#1 {main}</pre>
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'test');
require(__DIR__ . '/../vendor/autoload.php');
require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
Yii::setAlias('@tests', dirname(__DIR__) . '/tests');
$config = $config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../common/config/main.php'),
require(__DIR__ . '/../common/config/main-local.php'),
require(__DIR__ . '/../console/config/main.php'),
require(__DIR__ . '/../console/config/main-local.php'),
require (__DIR__. '/config/config.php')
);
$application = new yii\web\Application($config);
<?php
return [
'language' => 'en-US',
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=jobtest',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
],
],
];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question