Skip to content

Commit

Permalink
Корректировка конфига по умолчанию
Browse files Browse the repository at this point in the history
  • Loading branch information
vamcart committed Nov 28, 2018
1 parent a393a55 commit 45c64ed
Showing 1 changed file with 16 additions and 23 deletions.
39 changes: 16 additions & 23 deletions tests/bootstrap.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
'locales' => [APP . 'Locale' . DS],
]
]);

Cake\Core\Configure::write('debug', true);

$tmpDirectory = new \Cake\Filesystem\Folder(TMP);
Expand Down Expand Up @@ -85,28 +86,19 @@
'defaults' => 'php'
]);

// Ensure default test connection is defined
if (!getenv('db_class')) {
putenv('db_class=Cake\Database\Driver\Sqlite');
putenv('db_dsn=sqlite::memory:');
}
ConnectionManager::config('test', [
'className' => 'Cake\Database\Connection',
'driver' => getenv('db_class'),
'dsn' => getenv('db_dsn'),
'database' => getenv('db_database'),
'username' => getenv('db_login'),
'password' => getenv('db_password'),
'timezone' => 'UTC'
]);
ConnectionManager::config('test_migrations', [
'className' => 'Cake\Database\Connection',
'driver' => getenv('db_class'),
'dsn' => getenv('db_dsn'),
'database' => getenv('db_database'),
'username' => getenv('db_login'),
'password' => getenv('db_password'),
'timezone' => 'UTC'
Cake\Datasource\ConnectionManager::config('test', [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Sqlite',
'persistent' => false,
'host' => 'localhost',
//'port' => 'non_standard_port_number',
'username' => '',
'password' => '',
'database' => 'test',
'encoding' => 'utf8mb4',
'timezone' => 'UTC',
'cacheMetadata' => true,
'quoteIdentifiers' => true
]);

$settingsFixture = new \Vamshop\Core\Test\Fixture\SettingsFixture();
Expand All @@ -115,8 +107,9 @@
$settingsFixture->create(\Cake\Datasource\ConnectionManager::get('default'));
$settingsFixture->insert(\Cake\Datasource\ConnectionManager::get('default'));

Plugin::load('Acl', ['bootstrap' => true]);
Plugin::load('ADmad/JwtAuth');
Plugin::load('Vamshop/Core', ['bootstrap' => true, 'routes' => true]);
Plugin::load('Vamshop/Settings', ['bootstrap' => true, 'routes' => true]);

Cake\Routing\DispatcherFactory::add('Routing');
Cake\Routing\DispatcherFactory::add('ControllerFactory');
Expand Down

0 comments on commit 45c64ed

Please sign in to comment.