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
869d7b7c
Commit
869d7b7c
authored
Aug 12, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved test config
You can now customize test config without having uncommitted changes in git. issue #4687
parent
47b42ca8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
3 deletions
+35
-3
README.md
tests/README.md
+10
-0
.gitignore
tests/unit/.gitignore
+3
-2
config.php
tests/unit/data/config.php
+22
-1
No files found.
tests/README.md
View file @
869d7b7c
...
...
@@ -39,3 +39,13 @@ You can create your own phpunit.xml to override dist config.
Database and other backend system configuration can be found in
`unit/data/config.php`
adjust them to your needs to allow testing databases and caching in your environment.
You can override configuration values by creating a
`config.local.php`
file
and manipulate the
`$config`
variable.
For example to change MySQL username and password your
`config.local.php`
should
contain the following:
```
php
<?php
$config
[
'databases'
][
'mysql'
][
'username'
]
=
'yiitest'
;
$config
[
'databases'
][
'mysql'
][
'password'
]
=
'changeme'
;
```
tests/unit/.gitignore
View file @
869d7b7c
runtime/cache/*
\ No newline at end of file
/runtime/cache/*
/data/config.local.php
\ No newline at end of file
tests/unit/data/config.php
View file @
869d7b7c
<?php
return
[
/**
* This is the configuration file for the Yii2 unit tests.
* You can override configuration values by creating a `config.local.php` file
* and manipulate the `$config` variable.
* For example to change MySQL username and password your `config.local.php` should
* contain the following:
*
<?php
$config['databases']['mysql']['username'] = 'yiitest';
$config['databases']['mysql']['password'] = 'changeme';
*/
$config
=
[
'databases'
=>
[
'cubrid'
=>
[
'dsn'
=>
'cubrid:dbname=demodb;host=localhost;port=33000'
,
...
...
@@ -58,3 +72,9 @@ return [
'options'
=>
[],
]
];
if
(
is_file
(
__DIR__
.
'/config.local.php'
))
{
include
(
__DIR__
.
'/config.local.php'
);
}
return
$config
;
\ No newline at end of file
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