From 15a017b62942de7759e48f7a645c848c0a5b3bd5 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 28 Feb 2016 10:59:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/mock.php | 2 +- tests/thinkphp/library/think/debugTest.php | 7 ++----- tests/thinkphp/library/think/viewTest.php | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/mock.php b/tests/mock.php index d05289a6..adefb392 100644 --- a/tests/mock.php +++ b/tests/mock.php @@ -11,7 +11,7 @@ // 测试入口文件 $_SERVER['REQUEST_METHOD'] = 'GET'; - +date_default_timezone_set('UTC'); // 定义项目测试基础路径 define('TEST_PATH', __DIR__ . '/'); // 定义项目路径 diff --git a/tests/thinkphp/library/think/debugTest.php b/tests/thinkphp/library/think/debugTest.php index fe5e8f51..98258c13 100644 --- a/tests/thinkphp/library/think/debugTest.php +++ b/tests/thinkphp/library/think/debugTest.php @@ -135,10 +135,7 @@ class debugTest extends \PHPUnit_Framework_TestCase $str .= "mem"; } $memPeak = \think\Debug::getMemPeak($start, $end); - - // echo "\r\n" . $memPeak . "\r\n"; - - $this->assertLessThan(238, explode(" ", $memPeak)[0]); + $this->assertLessThan(355, explode(" ", $memPeak)[0]); } /** @@ -168,7 +165,7 @@ class debugTest extends \PHPUnit_Framework_TestCase $output = \think\Debug::dump($var, false, $label = "label"); $array = explode("array", json_encode($output)); if (IS_WIN) { - $this->assertEquals("(1) {\\n 'key' =>\\n string(3) \\\"val\\\"\\n}\\n\\r\\n\"", end($array)); + $this->assertEquals("(1) {\\n [\\\"key\\\"] => string(3) \\\"val\\\"\\n}\\n\\r\\n\"", end($array)); } else { $this->assertEquals("(1) {\\n 'key' =>\\n string(3) \\\"val\\\"\\n}\\n\\n\"", end($array)); } diff --git a/tests/thinkphp/library/think/viewTest.php b/tests/thinkphp/library/think/viewTest.php index 1e11cfdd..9ebcd906 100644 --- a/tests/thinkphp/library/think/viewTest.php +++ b/tests/thinkphp/library/think/viewTest.php @@ -124,7 +124,7 @@ class viewTest extends \PHPUnit_Framework_TestCase $view_instance = \think\View::instance(); $method = new \ReflectionMethod('\think\View', 'ParseTemplate'); $method->setAccessible(true); - $this->assertEquals('/theme_name/template_name.html', $method->invoke($view_instance, 'template_name')); + $this->assertEquals(DS . 'theme_name' . DS . 'template_name.html', $method->invoke($view_instance, 'template_name')); } /** @@ -137,6 +137,6 @@ class viewTest extends \PHPUnit_Framework_TestCase $view_instance = \think\View::instance(); $method = new \ReflectionMethod('\think\View', 'getThemePath'); $method->setAccessible(true); - $this->assertEquals('/theme_name/', $method->invoke($view_instance)); + $this->assertEquals(DS . 'theme_name' . DS, $method->invoke($view_instance)); } }