mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-30 15:52:17 +09:00
CI codeception 자동설치 테스트 추가
This commit is contained in:
parent
d1916d744f
commit
5cc8f55a64
7 changed files with 410 additions and 7 deletions
64
tests/Install/AutoinstallCept.php
Normal file
64
tests/Install/AutoinstallCept.php
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
use \Codeception\Configuration;
|
||||
|
||||
$I = new InstallTester($scenario);
|
||||
|
||||
$config = (!$this->env) ? Configuration::suiteSettings('Install', Configuration::config()) : Configuration::suiteEnvironments('Install')[$this->env];
|
||||
|
||||
$db_config = $config['modules']['config']['Db'];
|
||||
|
||||
$dsn = $db_config['dsn'];
|
||||
$dsn = split('[;:]', $dsn);
|
||||
$db_type = array_shift($dsn);
|
||||
$dbinfo = [
|
||||
'type' => $db_type,
|
||||
'user' => $db_config['user'],
|
||||
'password' => $db_config['password'],
|
||||
'port' => ((isset($db_config['port']) && $db_config['port'])?: 3306),
|
||||
];
|
||||
foreach($dsn as $piece) {
|
||||
list($key, $val) = explode('=', $piece);
|
||||
$dbinfo[$key] = $val;
|
||||
}
|
||||
|
||||
$install_config = array(
|
||||
'db_type' => $dbinfo['type'],
|
||||
'db_port' => $dbinfo['port'],
|
||||
'db_hostname' => $dbinfo['host'],
|
||||
'db_userid' => $dbinfo['user'],
|
||||
'db_password' => $dbinfo['password'],
|
||||
'db_database' => $dbinfo['dbname'],
|
||||
'db_table_prefix' =>'xe_',
|
||||
'use_rewrite' =>'N',
|
||||
'time_zone' =>'0900',
|
||||
'email_address' =>'admin@admin.net',
|
||||
'password' =>'admin',
|
||||
'password2' =>'admin',
|
||||
'nick_name' =>'admin',
|
||||
'user_id' =>'admin',
|
||||
'lang_type' => 'ko',
|
||||
);
|
||||
|
||||
$install_config = '<' . '?php $install_config = ' . var_export($install_config, true) . ';';
|
||||
|
||||
$I->wantTo('auto install');
|
||||
$I->writeToFile(_XE_PATH_ . 'config/install.config.php', $install_config);
|
||||
$I->amOnPage('/');
|
||||
|
||||
$I->wantTo('completed');
|
||||
$I->dontSeeElement('//div[@id="progress"]/ul/li');
|
||||
$I->amOnPage('/index.php?act=dispMemberLoginForm');
|
||||
|
||||
$I->fillField('user_id', 'admin@admin.net');
|
||||
$I->submitForm('.login-body form', [
|
||||
'act' => 'procMemberLogin',
|
||||
'user_id' => 'admin@admin.net',
|
||||
'password' => 'admin',
|
||||
'success_return_url' => '/index.php?module=admin'
|
||||
]);
|
||||
|
||||
$I->seeInCurrentUrl('module=admin');
|
||||
$I->seeElement('#gnbNav');
|
||||
$I->seeElement('#content .x_page-header');
|
||||
$I->see('설치 환경 수집 동의', 'h2');
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue