From 235e9f847fc3ed67b78f4de650c473ce90ca7dbe Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 23 Mar 2016 15:51:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4Loader::addNamespace=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E7=9A=84=E4=BD=8D=E7=BD=AE=20=E4=BF=AE=E6=AD=A3config?= =?UTF-8?q?Test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start.php | 6 +++--- tests/thinkphp/library/think/configTest.php | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/start.php b/start.php index 86ef2534..b2a5a311 100644 --- a/start.php +++ b/start.php @@ -30,9 +30,6 @@ if (!defined('APP_DEBUG')) { define('APP_DEBUG', $debug); } -// 注册自动加载 -Loader::register(); - // 加载模式定义文件 $mode = require MODE_PATH . APP_MODE . EXT; @@ -41,6 +38,9 @@ if (isset($mode['namespace'])) { Loader::addNamespace($mode['namespace']); } +// 注册自动加载 +Loader::register(); + // 加载模式别名定义 if (isset($mode['alias'])) { Loader::addMap($mode['alias']); diff --git a/tests/thinkphp/library/think/configTest.php b/tests/thinkphp/library/think/configTest.php index 959a8f3e..f0048a44 100644 --- a/tests/thinkphp/library/think/configTest.php +++ b/tests/thinkphp/library/think/configTest.php @@ -94,10 +94,9 @@ class configTest extends \PHPUnit_Framework_TestCase $this->assertEquals([], Config::get(null, $range)); $this->assertEquals(null, Config::get(null, 'does_not_exist')); // test $_ENV configuration - defined('ENV_PREFIX') or define('ENV_PREFIX', '_TEST_'); - $name = 'test_name'; - $value = 'value'; - $_ENV[ENV_PREFIX . $name] = $value; + $name = 'test_name'; + $value = 'value'; + putenv(ENV_PREFIX . $name . '=' . $value); $this->assertEquals($value, Config::get($name, $range)); // test getting configuration $reflectedPropertyConfig->setValue([$range => ['abcd' => 'efg']]);