diff --git a/data/class/SC_Initial.php b/data/class/SC_Initial.php index 202e6c3872..5585435978 100644 --- a/data/class/SC_Initial.php +++ b/data/class/SC_Initial.php @@ -68,7 +68,14 @@ public function init() */ public function requireInitialConfig() { - define('CONFIG_REALFILE', realpath(dirname(__FILE__)) . '/../config/config.php'); + $testConfig = realpath(dirname(__FILE__)) . '/../config/config4test.php'; + $configPath = realpath(dirname(__FILE__)) . '/../config/config.php'; + // テスト実行にはテスト用configファイルに + if (defined('TEST_FUNCTION') && TEST_FUNCTION && file_exists($testConfig)) { + $configPath = $testConfig; + } + define('CONFIG_REALFILE', $configPath); + if (file_exists(CONFIG_REALFILE)) { require_once CONFIG_REALFILE; diff --git a/data/config/config4test.php.example b/data/config/config4test.php.example new file mode 100644 index 0000000000..bcf21e20c8 --- /dev/null +++ b/data/config/config4test.php.example @@ -0,0 +1,27 @@ +