Skip to content

Commit

Permalink
added separate docker config for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
schmunk42 committed Feb 9, 2017
1 parent 0a4fdf2 commit 7b43cf0
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 7 deletions.
59 changes: 59 additions & 0 deletions tests/data/config-docker.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

/**
* This is the configuration file for the Yii 2 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=cubrid;port=33000',
'username' => 'dba',
'password' => '',
'fixture' => __DIR__ . '/cubrid.sql',
],
'mysql' => [
'dsn' => 'mysql:host=mysql;dbname=yiitest',
'username' => 'travis',
'password' => 'travis',
'fixture' => __DIR__ . '/mysql.sql',
],
'sqlite' => [
'dsn' => 'sqlite::memory:',
'fixture' => __DIR__ . '/sqlite.sql',
],
'sqlsrv' => [
'dsn' => 'sqlsrv:Server=mssql;Database=yii2test',
'username' => 'sa',
'password' => 'Microsoft-12345',
'fixture' => __DIR__ . '/mssql.sql',
],
'pgsql' => [
'dsn' => 'pgsql:host=postgres;dbname=yiitest;port=5432;',
'username' => 'postgres',
'password' => 'postgres',
'fixture' => __DIR__ . '/postgres.sql',
],
'oci' => [
'dsn' => 'oci:dbname=LOCAL_XE;charset=AL32UTF8;',
'username' => '',
'password' => '',
'fixture' => __DIR__ . '/oci.sql',
],
],
];

if (is_file(__DIR__ . '/config.local.php')) {
include(__DIR__ . '/config.local.php');
}

return $config;
14 changes: 7 additions & 7 deletions tests/data/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@
$config = [
'databases' => [
'cubrid' => [
'dsn' => 'cubrid:dbname=demodb;host=cubrid;port=33000',
'dsn' => 'cubrid:dbname=demodb;host=localhost;port=33000',
'username' => 'dba',
'password' => '',
'fixture' => __DIR__ . '/cubrid.sql',
],
'mysql' => [
'dsn' => 'mysql:host=mysql;dbname=yiitest',
'dsn' => 'mysql:host=127.0.0.1;dbname=yiitest',
'username' => 'travis',
'password' => 'travis',
'password' => '',
'fixture' => __DIR__ . '/mysql.sql',
],
'sqlite' => [
'dsn' => 'sqlite::memory:',
'fixture' => __DIR__ . '/sqlite.sql',
],
'sqlsrv' => [
'dsn' => 'sqlsrv:Server=mssql;Database=yii2test',
'username' => 'sa',
'password' => 'Microsoft-12345',
'dsn' => 'sqlsrv:Server=localhost;Database=test',
'username' => '',
'password' => '',
'fixture' => __DIR__ . '/mssql.sql',
],
'pgsql' => [
'dsn' => 'pgsql:host=postgres;dbname=yiitest;port=5432;',
'dsn' => 'pgsql:host=localhost;dbname=yiitest;port=5432;',
'username' => 'postgres',
'password' => 'postgres',
'fixture' => __DIR__ . '/postgres.sql',
Expand Down

0 comments on commit 7b43cf0

Please sign in to comment.