fixing some tests
This commit is contained in:
15
tests/_app/config/console.php
Normal file
15
tests/_app/config/console.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'id' => 'yii2-test-console',
|
||||
'basePath' => dirname(__DIR__),
|
||||
'aliases' => [
|
||||
'@Da/User' => dirname(dirname(dirname(__DIR__))) . '/lib/User',
|
||||
'@tests' => dirname(dirname(__DIR__)),
|
||||
],
|
||||
'components' => [
|
||||
'log' => null,
|
||||
'cache' => null,
|
||||
'db' => require __DIR__ . '/db.php',
|
||||
],
|
||||
];
|
||||
15
tests/_app/config/db.php
Normal file
15
tests/_app/config/db.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
$db = [
|
||||
'class' => 'yii\db\Connection',
|
||||
'dsn' => 'mysql:host=localhost;dbname=test',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
];
|
||||
|
||||
if (file_exists(__DIR__ . '/db.local.php')) {
|
||||
$db = array_merge($db, require(__DIR__ . '/db.local.php'));
|
||||
}
|
||||
|
||||
return $db;
|
||||
34
tests/_app/config/test.php
Normal file
34
tests/_app/config/test.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'id' => 'yii2-user-tests',
|
||||
'basePath' => dirname(__DIR__),
|
||||
'language' => 'en-US',
|
||||
'aliases' => [
|
||||
'@Da/User' => dirname(dirname(dirname(__DIR__))) . '/lib/User',
|
||||
'@tests' => dirname(dirname(__DIR__)),
|
||||
'@vendor' => VENDOR_DIR,
|
||||
'@bower' => VENDOR_DIR . '/bower-asset',
|
||||
],
|
||||
'bootstrap' => ['Da\User\Bootstrap'],
|
||||
'modules' => [
|
||||
'user' => [
|
||||
'class' => 'Da\User\Module',
|
||||
'administrators' => ['user'],
|
||||
],
|
||||
],
|
||||
'components' => [
|
||||
'db' => require __DIR__ . '/db.php',
|
||||
'mailer' => [
|
||||
'useFileTransport' => true,
|
||||
],
|
||||
'urlManager' => [
|
||||
'showScriptName' => true,
|
||||
],
|
||||
'request' => [
|
||||
'cookieValidationKey' => 'test',
|
||||
'enableCsrfValidation' => false,
|
||||
],
|
||||
],
|
||||
'params' => [],
|
||||
];
|
||||
Reference in New Issue
Block a user