Initial commit,修正

This commit is contained in:
2025-07-13 19:37:38 +08:00
parent 38ce288e27
commit 65bbd06981
12384 changed files with 3985464 additions and 8 deletions
@@ -0,0 +1,2 @@
# these files are auto generated by codeception build
/db-local.php
+11
View File
@@ -0,0 +1,11 @@
<?php
/**
* Application configuration for acceptance tests
*/
return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/config.php'),
require(__DIR__ . '/web.php'),
[
]
);
+48
View File
@@ -0,0 +1,48 @@
<?php
/**
* Application configuration shared by all test types
*/
return [
'id' => 'mdm-admin-test',
'basePath' => dirname(dirname(__DIR__)), // @tests
'vendorPath' => dirname(dirname(dirname(__DIR__))) . '/vendor',
'language' => 'en-US',
'aliases' => [
'@mdm/admin' => dirname(dirname(dirname(__DIR__))),
],
'modules' => [
'admin' => [
'class' => 'mdm\admin\Module',
]
],
'controllerMap' => [
'fixture' => [
'class' => 'yii\console\controllers\FixtureController',
'namespace' => 'tests\codeception\fixtures',
],
],
'components' => [
'db' => require(__DIR__ . '/db.php'),
'mailer' => [
'useFileTransport' => true,
],
'urlManager' => [
'showScriptName' => true,
],
'authManager' => [
'class' => 'yii\rbac\DbManager'
],
'cache' => [
'class' => 'yii\caching\DummyCache',
],
'i18n' => [
'translations' => [
'rbac-admin' => [
'class' => 'yii\i18n\PhpMessageSource',
'sourceLanguage' => 'en',
'basePath' => '@mdm/admin/messages'
]
]
]
],
];
+5
View File
@@ -0,0 +1,5 @@
<?php
return[
'components' => [
]
];
+36
View File
@@ -0,0 +1,36 @@
<?php
/**
* This is the configuration file for the yii2-admin unit tests.
* You can override configuration values by creating a `db-local.php` file
* and manipulate the `$databases` variable.
* For example to change MySQL username and password your `db-local.php` should
* contain the following:
*
<?php
$driver = 'pgsql';
$databases[$driver]['username'] = 'myname';
$databases[$driver]['password'] = 'changeme';
*/
$databases = [
'mysql' => [
'dsn' => 'mysql:host=127.0.0.1;dbname=mdm_admin_test',
'username' => 'travis',
'password' => '',
],
'sqlite' => [
//'dsn' => 'sqlite::memory:',
'dsn' => 'sqlite:@runtime/mdm_admin_test.sqlite',
],
'pgsql' => [
'dsn' => 'pgsql:host=localhost;dbname=mdm_admin_test;port=5432;',
'username' => 'postgres',
'password' => 'postgres',
],
];
$driver = 'mysql';
if (is_file(__DIR__ . '/db-local.php')) {
include __DIR__ . '/db-local.php';
}
return array_merge(['class' => 'yii\db\Connection'], $databases[$driver]);
+25
View File
@@ -0,0 +1,25 @@
<?php
$_SERVER['SCRIPT_FILENAME'] = YII_TEST_ENTRY_FILE;
$_SERVER['SCRIPT_NAME'] = YII_TEST_ENTRY_URL;
/**
* Application configuration for functional tests
*/
return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/config.php'),
require(__DIR__ . '/web.php'),
[
'components' => [
'request' => [
// it's not recommended to run functional tests with CSRF validation enabled
'enableCsrfValidation' => false,
// but if you absolutely need it set cookie domain to localhost
/*
'csrfCookie' => [
'domain' => 'localhost',
],
*/
],
],
]
);
+11
View File
@@ -0,0 +1,11 @@
<?php
/**
* Application configuration for unit tests
*/
return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/config.php'),
require(__DIR__ . '/web.php'),
[
]
);
+8
View File
@@ -0,0 +1,8 @@
<?php
return[
'components' => [
'request' => [
'cookieValidationKey' => 'testme',
],
]
];