Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
0766ddca
Commit
0766ddca
authored
Dec 30, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1701.
parent
c88016f9
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
26 deletions
+36
-26
web.php
apps/basic/config/web.php
+0
-7
_bootstrap.php
apps/basic/tests/_bootstrap.php
+1
-1
_config.php
apps/basic/tests/_config.php
+11
-0
_config.php
apps/basic/tests/acceptance/_config.php
+9
-6
_config.php
apps/basic/tests/functional/_config.php
+9
-6
_config.php
apps/basic/tests/unit/_config.php
+6
-6
No files found.
apps/basic/config/web.php
View file @
0766ddca
...
@@ -47,11 +47,4 @@ if (YII_ENV_DEV) {
...
@@ -47,11 +47,4 @@ if (YII_ENV_DEV) {
$config
[
'modules'
][
'gii'
]
=
'yii\gii\Module'
;
$config
[
'modules'
][
'gii'
]
=
'yii\gii\Module'
;
}
}
if
(
YII_ENV_TEST
)
{
// configuration adjustments for 'test' environment.
// configuration for codeception test environments can be found in codeception folder.
// if needed, customize $config here.
}
return
$config
;
return
$config
;
apps/basic/tests/_bootstrap.php
View file @
0766ddca
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// the entry script URL (without host info) for functional and acceptance tests
// the entry script URL (without host info) for functional and acceptance tests
// PLEASE ADJUST IT TO THE ACTUAL ENTRY SCRIPT URL
// PLEASE ADJUST IT TO THE ACTUAL ENTRY SCRIPT URL
defined
(
'TEST_ENTRY_URL'
)
or
define
(
'TEST_ENTRY_URL'
,
'/
yii2-
basic/web/index-test.php'
);
defined
(
'TEST_ENTRY_URL'
)
or
define
(
'TEST_ENTRY_URL'
,
'/basic/web/index-test.php'
);
// the entry script file path for functional and acceptance tests
// the entry script file path for functional and acceptance tests
defined
(
'TEST_ENTRY_FILE'
)
or
define
(
'TEST_ENTRY_FILE'
,
dirname
(
__DIR__
)
.
'/web/index-test.php'
);
defined
(
'TEST_ENTRY_FILE'
)
or
define
(
'TEST_ENTRY_FILE'
,
dirname
(
__DIR__
)
.
'/web/index-test.php'
);
...
...
apps/basic/tests/_config.php
0 → 100644
View file @
0766ddca
<?php
/**
* application configurations shared by all test types
*/
return
[
'components'
=>
[
'mail'
=>
[
'useFileTransport'
=>
true
,
],
],
];
apps/basic/tests/acceptance/_config.php
View file @
0766ddca
<?php
<?php
use
yii\helpers\ArrayHelper
;
return
yii\helpers\ArrayHelper
::
merge
(
require
(
__DIR__
.
'/../../config/web.php'
),
$config
=
require
(
__DIR__
.
'/../../config/web.php'
);
require
(
__DIR__
.
'/../_config.php'
),
[
return
ArrayHelper
::
merge
(
$config
,
[
'components'
=>
[
'components'
=>
[
'db'
=>
[
'db'
=>
[
'dsn'
=>
'mysql:host=localhost;dbname=yii2_basic_acceptance'
,
'dsn'
=>
'mysql:host=localhost;dbname=yii2_basic_acceptance'
,
],
],
'mail'
=>
[
'useFileTransport'
=>
true
,
],
'urlManager'
=>
[
'urlManager'
=>
[
'showScriptName'
=>
true
,
'showScriptName'
=>
true
,
],
],
],
],
]);
]
);
apps/basic/tests/functional/_config.php
View file @
0766ddca
<?php
<?php
use
yii\helpers\ArrayHelper
;
// set correct script paths
// set correct script paths
$_SERVER
[
'SCRIPT_FILENAME'
]
=
TEST_ENTRY_FILE
;
$_SERVER
[
'SCRIPT_FILENAME'
]
=
TEST_ENTRY_FILE
;
$_SERVER
[
'SCRIPT_NAME'
]
=
TEST_ENTRY_URL
;
$_SERVER
[
'SCRIPT_NAME'
]
=
TEST_ENTRY_URL
;
$config
=
require
(
__DIR__
.
'/../../config/web.php'
);
return
yii\helpers\ArrayHelper
::
merge
(
require
(
__DIR__
.
'/../../config/web.php'
),
return
ArrayHelper
::
merge
(
$config
,
[
require
(
__DIR__
.
'/../_config.php'
),
[
'components'
=>
[
'components'
=>
[
'db'
=>
[
'db'
=>
[
'dsn'
=>
'mysql:host=localhost;dbname=yii2_basic_functional'
,
'dsn'
=>
'mysql:host=localhost;dbname=yii2_basic_functional'
,
],
],
'mail'
=>
[
'useFileTransport'
=>
true
,
],
'urlManager'
=>
[
'urlManager'
=>
[
'showScriptName'
=>
true
,
'showScriptName'
=>
true
,
],
],
],
],
]);
]
);
apps/basic/tests/unit/_config.php
View file @
0766ddca
<?php
<?php
use
yii\helpers\ArrayHelper
;
return
yii\helpers\ArrayHelper
::
merge
(
require
(
__DIR__
.
'/../../config/web.php'
),
$config
=
require
(
__DIR__
.
'/../../config/web.php'
);
require
(
__DIR__
.
'/../_config.php'
),
[
return
ArrayHelper
::
merge
(
$config
,
[
'components'
=>
[
'components'
=>
[
'fixture'
=>
[
'fixture'
=>
[
'class'
=>
'yii\test\DbFixtureManager'
,
'class'
=>
'yii\test\DbFixtureManager'
,
...
@@ -14,4 +13,5 @@ return ArrayHelper::merge($config, [
...
@@ -14,4 +13,5 @@ return ArrayHelper::merge($config, [
'dsn'
=>
'mysql:host=localhost;dbname=yii2_basic_unit'
,
'dsn'
=>
'mysql:host=localhost;dbname=yii2_basic_unit'
,
],
],
],
],
]);
]
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment