diff --git a/tests/thinkphp/library/think/DebugTest.php b/tests/thinkphp/library/think/DebugTest.php index b51a8a7d..7a792d8f 100644 --- a/tests/thinkphp/library/think/DebugTest.php +++ b/tests/thinkphp/library/think/DebugTest.php @@ -6,14 +6,19 @@ // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- -// | Author: 大漠 +// | Author: liu21st // +---------------------------------------------------------------------- -namespace think; /** - * Generated by PHPUnit_SkeletonGenerator on 2016-01-15 at 07:00:38. + * Debug测试 + * @author 大漠 */ -class DebugTest extends \PHPUnit_Framework_TestCase + +namespace tests\thinkphp\library\think; + +use think\Debug; + +class debugTest extends \PHPUnit_Framework_TestCase { /** diff --git a/tests/thinkphp/library/think/InputTest.php b/tests/thinkphp/library/think/InputTest.php index 4fce502b..52740409 100644 --- a/tests/thinkphp/library/think/InputTest.php +++ b/tests/thinkphp/library/think/InputTest.php @@ -2,20 +2,27 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2015 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- -// | Author: Haotong Lin +// | Author: liu21st // +---------------------------------------------------------------------- +/** + * Input测试 + * @author Haotong Lin + */ + +namespace tests\thinkphp\library\think; + use think\Input; -class InputTest extends \PHPUnit_Framework_TestCase +class inputTest extends \PHPUnit_Framework_TestCase { public function testEmptyStringName() { - $input = ['a' => 'test']; + $input = ['a' => 'test']; $this->assertEquals($input, Input::getData('', $input, 'trim')); } @@ -54,7 +61,7 @@ class InputTest extends \PHPUnit_Framework_TestCase { $src = 'EXP|NEQ|GT|EGT|LT|ELT|OR|XOR|LIKE|NOTLIKE|NOT BETWEEN|NOTBETWEEN|BETWEEN|NOTIN|NOT IN|IN'; $regexs = explode('|', $src); - $data = Input::getData('', $regexs); + $data = Input::getData('', $regexs); foreach ($regexs as $key => $value) { $expected = $value . ' '; $this->assertEquals($expected, $data[$key]); @@ -122,7 +129,7 @@ class InputTest extends \PHPUnit_Framework_TestCase public function testSuperglobals() { Input::setFilter('trim'); - $_GET['get'] = 'get value '; + $_GET['get'] = 'get value '; $this->assertEquals('get value', Input::get('get')); $_POST['post'] = 'post value '; $this->assertEquals('post value', Input::post('post')); diff --git a/tests/thinkphp/library/think/ResponseTest.php b/tests/thinkphp/library/think/ResponseTest.php index 2929477f..b4b6da06 100644 --- a/tests/thinkphp/library/think/ResponseTest.php +++ b/tests/thinkphp/library/think/ResponseTest.php @@ -6,14 +6,17 @@ // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- -// | Author: 大漠 +// | Author: liu21st // +---------------------------------------------------------------------- -namespace think; /** - * Generated by PHPUnit_SkeletonGenerator on 2016-01-14 at 21:32:07. + * Response测试 + * @author 大漠 */ -class ResponseTest extends \PHPUnit_Framework_TestCase + +namespace tests\thinkphp\library\think; + +class responseTest extends \PHPUnit_Framework_TestCase { /** @@ -36,10 +39,10 @@ class ResponseTest extends \PHPUnit_Framework_TestCase // restore_error_handler(); // Warning: Cannot modify header information - headers already sent by (output started at PHPUnit\Util\Printer.php:173) // more see in https://www.analysisandsolutions.com/blog/html/writing-phpunit-tests-for-wordpress-plugins-wp-redirect-and-continuing-after-php-errors.htm - + // 2. // the Symfony used the HeaderMock.php - + // 3. // not run the eclipse will held, and travis-ci.org Searching for coverage reports // **> Python coverage not found @@ -48,10 +51,10 @@ class ResponseTest extends \PHPUnit_Framework_TestCase // /** // * @runInSeparateProcess // */ - if (! $this->default_return_type) { + if (!$this->default_return_type) { $this->default_return_type = \think\Config::get('default_return_type'); } - if (! $this->default_ajax_return) { + if (!$this->default_ajax_return) { $this->default_ajax_return = \think\Config::get('default_ajax_return'); } } @@ -73,29 +76,29 @@ class ResponseTest extends \PHPUnit_Framework_TestCase */ public function testSend() { - $dataArr = array(); + $dataArr = array(); $dataArr["key"] = "value"; - $dataArr->key = "val"; - + $dataArr->key = "val"; + $result = \think\Response::send($dataArr, "", true); $this->assertArrayHasKey("key", $result); - + $result = \think\Response::send($dataArr, "json", true); $this->assertEquals('{"key":"value"}', $result); - - $handler = "callback"; + + $handler = "callback"; $_GET[\think\Config::get('var_jsonp_handler')] = $handler; - $result = \think\Response::send($dataArr, "jsonp", true); + $result = \think\Response::send($dataArr, "jsonp", true); $this->assertEquals('callback({"key":"value"});', $result); - + \think\Response::tramsform(function () { - + return "callbackreturndata"; }); - + $result = \think\Response::send($dataArr, "", true); $this->assertEquals("callbackreturndata", $result); - $_GET[\think\Config::get('var_jsonp_handler')]=""; + $_GET[\think\Config::get('var_jsonp_handler')] = ""; } /** @@ -105,13 +108,13 @@ class ResponseTest extends \PHPUnit_Framework_TestCase public function testTramsform() { \think\Response::tramsform(function () { - + return "callbackreturndata"; }); - + $result = \think\Response::send($dataArr, "", true); $this->assertEquals("callbackreturndata", $result); - + \think\Response::tramsform(null); } @@ -123,7 +126,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase { $type = "json"; \think\Response::type($type); - + $result = \think\Response::type(); $this->assertEquals($type, $result); \think\Response::type($type); @@ -148,7 +151,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase { $isExit = true; \think\Response::isExit($isExit); - + $result = \think\Response::isExit(); $this->assertTrue($isExit, $result); \think\Response::isExit(false); @@ -160,12 +163,12 @@ class ResponseTest extends \PHPUnit_Framework_TestCase */ public function testResult() { - $data = "data"; - $code = "1001"; - $msg = "the msg"; - $type = "json"; + $data = "data"; + $code = "1001"; + $msg = "the msg"; + $type = "json"; $result = \think\Response::result($data, $code, $msg, $type); - + $this->assertEquals($code, $result["code"]); $this->assertEquals($msg, $result["msg"]); $this->assertEquals($data, $result["data"]); @@ -180,47 +183,47 @@ class ResponseTest extends \PHPUnit_Framework_TestCase public function testSuccess() { // round 1 - $msg = 1001; + $msg = 1001; $data = "data"; - - $url = "www.HTTP_REFERER.com"; - $HTTP_REFERER = $_SERVER["HTTP_REFERER"]; + + $url = "www.HTTP_REFERER.com"; + $HTTP_REFERER = $_SERVER["HTTP_REFERER"]; $_SERVER["HTTP_REFERER"] = $url; \think\Config::set('default_return_type', "json"); - + $result = \think\Response::success($msg, $data); - + $this->assertEquals($msg, $result["code"]); - + $this->assertEquals($data, $result["data"]); $this->assertEquals($url, $result["url"]); $this->assertEquals("json", \think\Response::type()); $this->assertEquals(3, $result["wait"]); - + // round 2 $msg = "the msg"; $url = "www.thinkphptestsucess.com"; - + $result = \think\Response::success($msg, $data, $url); - + $this->assertEquals($msg, $result["msg"]); $this->assertEquals($url, $result["url"]); - + // round 3 异常在travis-ci中未能重现 // $this->setExpectedException('\think\Exception'); // FIXME 静态方法mock // $oMockView = $this->getMockBuilder('\think\View')->setMethods(array( // 'fetch' // ))->getMock(); - + // $oMockView->expects($this->any())->method('fetch')->will($this->returnValue('content')); - + // \think\Config::set('default_return_type', "html"); // $result = \think\Response::success($msg, $data, $url); - + // FIXME 静态方法mock // $this->assertEquals('content', $result); - + $_SERVER["HTTP_REFERER"] = $HTTP_REFERER; } @@ -231,41 +234,41 @@ class ResponseTest extends \PHPUnit_Framework_TestCase public function testError() { // round 1 - $msg = 1001; + $msg = 1001; $data = "data"; - + \think\Config::set('default_return_type', "json"); - + $result = \think\Response::error($msg, $data); - + $this->assertEquals($msg, $result["code"]); $this->assertEquals($data, $result["data"]); $this->assertEquals('javascript:history.back(-1);', $result["url"]); $this->assertEquals("json", \think\Response::type()); $this->assertEquals(3, $result["wait"]); - + // round 2 $msg = "the msg"; $url = "www.thinkphptesterror.com"; - + $result = \think\Response::error($msg, $data, $url); - + $this->assertEquals($msg, $result["msg"]); $this->assertEquals($url, $result["url"]); - + // round 3 异常在travis-ci中未能重现 // $this->setExpectedException('\think\Exception'); // FIXME 静态方法mock // $oMockView = $this->getMockBuilder('\think\View')->setMethods(array( // 'fetch' // ))->getMock(); - + // $oMockView->expects($this->any())->method('fetch')->will($this->returnValue('content')); - + // \think\Config::set('default_return_type', "html"); - + // $result = \think\Response::error($msg, $data, $url); - + // FIXME 静态方法mock // $this->assertEquals('content', $result); } @@ -280,11 +283,11 @@ class ResponseTest extends \PHPUnit_Framework_TestCase // $url = "http://www.testredirect.com"; // $params = array(); // $params[] = 301; - + // // FIXME 静态方法mock Url::build // // echo "\r\n" . json_encode(xdebug_get_headers()) . "\r\n"; // \think\Response::redirect($url, $params); - + // $this->assertContains('Location: ' . $url, xdebug_get_headers()); } @@ -312,4 +315,4 @@ class ResponseTest extends \PHPUnit_Framework_TestCase // $this->assertContains('HTTP/1.1 ' . ': ' . $status, xdebug_get_headers()); // $this->assertContains('Status:' . ': ' . $status, xdebug_get_headers()); } -} +} diff --git a/tests/thinkphp/library/think/SessionTest.php b/tests/thinkphp/library/think/SessionTest.php index a1e8f472..65b42906 100644 --- a/tests/thinkphp/library/think/SessionTest.php +++ b/tests/thinkphp/library/think/SessionTest.php @@ -6,14 +6,17 @@ // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- -// | Author: 大漠 +// | Author: liu21st // +---------------------------------------------------------------------- -namespace think; /** - * Generated by PHPUnit_SkeletonGenerator on 2016-01-14 at 02:40:08. + * Session测试 + * @author 大漠 */ -class SessionTest extends \PHPUnit_Framework_TestCase + +namespace tests\thinkphp\library\think; + +class sessionTest extends \PHPUnit_Framework_TestCase { /** @@ -55,7 +58,7 @@ class SessionTest extends \PHPUnit_Framework_TestCase { \think\Session::prefix(null); \think\Session::prefix('think_'); - + $this->assertEquals('think_', \think\Session::prefix()); } @@ -69,58 +72,58 @@ class SessionTest extends \PHPUnit_Framework_TestCase \think\Session::prefix(null); $config = [ // cookie 名称前缀 - 'prefix' => 'think_', + 'prefix' => 'think_', // cookie 保存时间 - 'expire' => 60, + 'expire' => 60, // cookie 保存路径 - 'path' => '/path/to/test/session/', + 'path' => '/path/to/test/session/', // cookie 有效域名 - 'domain' => '.thinkphp.cn', + 'domain' => '.thinkphp.cn', 'var_session_id' => 'sessionidtest', - 'id' => 'sess_8fhgkjuakhatbeg2fa14lo84q1', - 'name' => 'session_name', - 'use_trans_sid' => '1', - 'use_cookies' => '1', - 'cache_limiter' => '60', - 'cache_expire' => '60', - 'type' => '', // memcache - 'namespace' => '\\think\\session\\driver\\', // ? - 'auto_start' => '1' + 'id' => 'sess_8fhgkjuakhatbeg2fa14lo84q1', + 'name' => 'session_name', + 'use_trans_sid' => '1', + 'use_cookies' => '1', + 'cache_limiter' => '60', + 'cache_expire' => '60', + 'type' => '', // memcache + 'namespace' => '\\think\\session\\driver\\', // ? + 'auto_start' => '1', ]; - + $_REQUEST[$config['var_session_id']] = $config['id']; \think\Session::init($config); - + // 开始断言 $this->assertEquals($config['prefix'], \think\Session::prefix()); $this->assertEquals($config['id'], $_REQUEST[$config['var_session_id']]); $this->assertEquals($config['name'], session_name()); - + $this->assertEquals($config['path'], session_save_path()); $this->assertEquals($config['use_cookies'], ini_get('session.use_cookies')); $this->assertEquals($config['domain'], ini_get('session.cookie_domain')); $this->assertEquals($config['expire'], ini_get('session.gc_maxlifetime')); $this->assertEquals($config['expire'], ini_get('session.cookie_lifetime')); - + $this->assertEquals($config['cache_limiter'], session_cache_limiter($config['cache_limiter'])); $this->assertEquals($config['cache_expire'], session_cache_expire($config['cache_expire'])); - + // 检测分支 $_REQUEST[$config['var_session_id']] = null; session_write_close(); session_destroy(); - + \think\Session::init($config); - + // 测试auto_start // PHP_SESSION_DISABLED // PHP_SESSION_NONE // PHP_SESSION_ACTIVE // session_status() $this->assertEquals(0, ini_get('session.auto_start')); - + $this->assertEquals($config['use_trans_sid'], ini_get('session.use_trans_sid')); - + \think\Session::init($config); $this->assertEquals($config['id'], session_id()); } @@ -133,29 +136,29 @@ class SessionTest extends \PHPUnit_Framework_TestCase { $config = [ // cookie 名称前缀 - 'prefix' => 'think_', + 'prefix' => 'think_', // cookie 保存时间 - 'expire' => 0, + 'expire' => 0, // cookie 保存路径 - 'path' => '/path/to/test/session/', + 'path' => '/path/to/test/session/', // cookie 有效域名 - 'domain' => '.thinkphp.cn', + 'domain' => '.thinkphp.cn', 'var_session_id' => 'sessionidtest', - 'id' => 'sess_8fhgkjuakhatbeg2fa14lo84q1', - 'name' => 'session_name', - 'use_trans_sid' => '1', - 'use_cookies' => '1', - 'cache_limiter' => '60', - 'cache_expire' => '60', - 'type' => 'memcache', // - 'namespace' => '\\think\\session\\driver\\', // ? - 'auto_start' => '1' + 'id' => 'sess_8fhgkjuakhatbeg2fa14lo84q1', + 'name' => 'session_name', + 'use_trans_sid' => '1', + 'use_cookies' => '1', + 'cache_limiter' => '60', + 'cache_expire' => '60', + 'type' => 'memcache', // + 'namespace' => '\\think\\session\\driver\\', // ? + 'auto_start' => '1', ]; - + // 测试session驱动是否存在 // @expectedException 异常类名 $this->setExpectedException('\think\Exception', 'error session handler', 11700); - + \think\Session::init($config); } @@ -169,13 +172,13 @@ class SessionTest extends \PHPUnit_Framework_TestCase \think\Session::prefix(null); \think\Session::set('sessionname', 'sessionvalue'); $this->assertEquals('sessionvalue', $_SESSION['sessionname']); - + \think\Session::set('sessionnamearr.subname', 'sessionvalue'); $this->assertEquals('sessionvalue', $_SESSION['sessionnamearr']['subname']); - + \think\Session::set('sessionnameper', 'sessionvalue', 'think_'); $this->assertEquals('sessionvalue', $_SESSION['think_']['sessionnameper']); - + \think\Session::set('sessionnamearrper.subname', 'sessionvalue', 'think_'); $this->assertEquals('sessionvalue', $_SESSION['think_']['sessionnamearrper']['subname']); } @@ -188,19 +191,19 @@ class SessionTest extends \PHPUnit_Framework_TestCase public function testGet() { \think\Session::prefix(null); - + \think\Session::set('sessionnameget', 'sessionvalue'); $this->assertEquals(\think\Session::get('sessionnameget'), $_SESSION['sessionnameget']); - + \think\Session::set('sessionnamegetarr.subname', 'sessionvalue'); $this->assertEquals(\think\Session::get('sessionnamegetarr.subname'), $_SESSION['sessionnamegetarr']['subname']); - + \think\Session::set('sessionnamegetarrperall', 'sessionvalue', 'think_'); $this->assertEquals(\think\Session::get('', 'think_')['sessionnamegetarrperall'], $_SESSION['think_']['sessionnamegetarrperall']); - + \think\Session::set('sessionnamegetper', 'sessionvalue', 'think_'); $this->assertEquals(\think\Session::get('sessionnamegetper', 'think_'), $_SESSION['think_']['sessionnamegetper']); - + \think\Session::set('sessionnamegetarrper.subname', 'sessionvalue', 'think_'); $this->assertEquals(\think\Session::get('sessionnamegetarrper.subname', 'think_'), $_SESSION['think_']['sessionnamegetarrper']['subname']); } @@ -216,15 +219,15 @@ class SessionTest extends \PHPUnit_Framework_TestCase \think\Session::set('sessionnamedel', 'sessionvalue'); \think\Session::delete('sessionnamedel'); $this->assertEmpty($_SESSION['sessionnamedel']); - + \think\Session::set('sessionnamedelarr.subname', 'sessionvalue'); \think\Session::delete('sessionnamedelarr.subname'); $this->assertEmpty($_SESSION['sessionnamedelarr']['subname']); - + \think\Session::set('sessionnamedelper', 'sessionvalue', 'think_'); \think\Session::delete('sessionnamedelper', 'think_'); $this->assertEmpty($_SESSION['think_']['sessionnamedelper']); - + \think\Session::set('sessionnamedelperarr.subname', 'sessionvalue', 'think_'); \think\Session::delete('sessionnamedelperarr.subname', 'think_'); $this->assertEmpty($_SESSION['think_']['sessionnamedelperarr']['subname']); @@ -238,11 +241,11 @@ class SessionTest extends \PHPUnit_Framework_TestCase public function testClear() { \think\Session::prefix(null); - + \think\Session::set('sessionnameclsper', 'sessionvalue1', 'think_'); \think\Session::clear('think_'); $this->assertNull($_SESSION['think_']); - + \think\Session::set('sessionnameclsper', 'sessionvalue1', 'think_'); \think\Session::clear(); $this->assertEmpty($_SESSION); @@ -258,13 +261,13 @@ class SessionTest extends \PHPUnit_Framework_TestCase \think\Session::prefix(null); \think\Session::set('sessionnamehas', 'sessionvalue'); $this->assertTrue(\think\Session::has('sessionnamehas')); - + \think\Session::set('sessionnamehasarr.subname', 'sessionvalue'); $this->assertTrue(\think\Session::has('sessionnamehasarr.subname')); - + \think\Session::set('sessionnamehasper', 'sessionvalue', 'think_'); $this->assertTrue(\think\Session::has('sessionnamehasper', 'think_')); - + \think\Session::set('sessionnamehasarrper.subname', 'sessionvalue', 'think_'); $this->assertTrue(\think\Session::has('sessionnamehasarrper.subname', 'think_')); } @@ -300,4 +303,4 @@ class SessionTest extends \PHPUnit_Framework_TestCase \think\Session::destroy(); $this->assertEmpty($_SESSION['sessionnamedestroy']); } -} +} diff --git a/tests/thinkphp/library/think/ViewTest.php b/tests/thinkphp/library/think/ViewTest.php index 0d7f7844..e925285f 100644 --- a/tests/thinkphp/library/think/ViewTest.php +++ b/tests/thinkphp/library/think/ViewTest.php @@ -2,17 +2,19 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2015 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- -// | Author: mahuan +// | Author: liu21st // +---------------------------------------------------------------------- + /** * view测试 * @author mahuan */ -namespace think; + +namespace tests\thinkphp\library\think; class viewTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/thinkphp/library/think/appTest.php b/tests/thinkphp/library/think/appTest.php index cff6b227..7a10f7d2 100644 --- a/tests/thinkphp/library/think/appTest.php +++ b/tests/thinkphp/library/think/appTest.php @@ -6,10 +6,15 @@ // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- -// | Author: Haotong Lin +// | Author: liu21st // +---------------------------------------------------------------------- -namespace think; +/** + * app类测试 + * @author Haotong Lin + */ + +namespace tests\thinkphp\library\think; class appTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/thinkphp/library/think/cache/driver/CacheTestCase.php b/tests/thinkphp/library/think/cache/driver/CacheTestCase.php index aa718e55..2bf87f58 100644 --- a/tests/thinkphp/library/think/cache/driver/CacheTestCase.php +++ b/tests/thinkphp/library/think/cache/driver/CacheTestCase.php @@ -1,14 +1,24 @@ +// +---------------------------------------------------------------------- /** * 缓存抽象类,提供一些测试 * @author simon */ -abstract class CacheTestCase extends \PHPUnit_Framework_TestCase + +namespace tests\thinkphp\library\think\cache\driver; + +use think\cache; + +abstract class cacheTestCase extends \PHPUnit_Framework_TestCase { /** diff --git a/tests/thinkphp/library/think/cache/driver/apcTest.php b/tests/thinkphp/library/think/cache/driver/apcTest.php index 24e00c62..0557c412 100644 --- a/tests/thinkphp/library/think/cache/driver/apcTest.php +++ b/tests/thinkphp/library/think/cache/driver/apcTest.php @@ -8,13 +8,15 @@ // +---------------------------------------------------------------------- // | Author: liu21st // +---------------------------------------------------------------------- + /** * Apc缓存驱动测试 * @author mahuan */ + namespace tests\thinkphp\library\think\cache\driver; -class apcTest extends CacheTestCase +class apcTest extends cacheTestCase { private $_cacheInstance = null; /** diff --git a/tests/thinkphp/library/think/cache/driver/dbTest.php b/tests/thinkphp/library/think/cache/driver/dbTest.php index 8702fd7c..9c896d4f 100644 --- a/tests/thinkphp/library/think/cache/driver/dbTest.php +++ b/tests/thinkphp/library/think/cache/driver/dbTest.php @@ -13,9 +13,10 @@ * 数据库缓存驱动测试 * @author mahuan */ + namespace tests\thinkphp\library\think\cache\driver; -class dbTest extends CacheTestCase +class dbTest extends cacheTestCase { private $_cacheInstance = null; diff --git a/tests/thinkphp/library/think/config/driver/iniTest.php b/tests/thinkphp/library/think/config/driver/iniTest.php index eddfea3b..2575157c 100644 --- a/tests/thinkphp/library/think/config/driver/iniTest.php +++ b/tests/thinkphp/library/think/config/driver/iniTest.php @@ -11,11 +11,10 @@ /** * Ini配置测试 - * * @author 7IN0SAN9 */ -namespace think\config\driver; +namespace tests\thinkphp\library\think\config\driver; use think\config; diff --git a/tests/thinkphp/library/think/config/driver/xmlTest.php b/tests/thinkphp/library/think/config/driver/xmlTest.php index cf33d8a7..9ab1d257 100644 --- a/tests/thinkphp/library/think/config/driver/xmlTest.php +++ b/tests/thinkphp/library/think/config/driver/xmlTest.php @@ -11,11 +11,10 @@ /** * Xml配置测试 - * * @author 7IN0SAN9 */ -namespace think\config\driver; +namespace tests\thinkphp\library\think\config\driver; use think\config; diff --git a/tests/thinkphp/library/think/configTest.php b/tests/thinkphp/library/think/configTest.php index b55d0e6e..92b46788 100644 --- a/tests/thinkphp/library/think/configTest.php +++ b/tests/thinkphp/library/think/configTest.php @@ -6,12 +6,18 @@ // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- -// | Author: Haotong Lin +// | Author: liu21st // +---------------------------------------------------------------------- -namespace think; +/** + * 配置测试 + * @author Haotong Lin + */ + +namespace tests\thinkphp\library\think; use ReflectionClass; +use think\Config; class configTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/thinkphp/library/think/controllerTest.php b/tests/thinkphp/library/think/controllerTest.php index 12dcc6e4..00ad6c0d 100644 --- a/tests/thinkphp/library/think/controllerTest.php +++ b/tests/thinkphp/library/think/controllerTest.php @@ -6,10 +6,15 @@ // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- -// | Author: Haotong Lin +// | Author: liu21st // +---------------------------------------------------------------------- -namespace think; +/** + * 控制器测试 + * @author Haotong Lin + */ + +namespace tests\thinkphp\library\think; require_once CORE_PATH . '../../helper.php'; diff --git a/tests/thinkphp/library/think/cookieTest.php b/tests/thinkphp/library/think/cookieTest.php index 2ed56bce..2f379f73 100644 --- a/tests/thinkphp/library/think/cookieTest.php +++ b/tests/thinkphp/library/think/cookieTest.php @@ -6,10 +6,15 @@ // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- -// | Author: Haotong Lin +// | Author: liu21st // +---------------------------------------------------------------------- -namespace think; +/** + * Cookie测试 + * @author Haotong Lin + */ + +namespace tests\thinkphp\library\think; use ReflectionClass; diff --git a/tests/thinkphp/library/think/templateTest.php b/tests/thinkphp/library/think/templateTest.php index 69dbd7b3..86240afc 100644 --- a/tests/thinkphp/library/think/templateTest.php +++ b/tests/thinkphp/library/think/templateTest.php @@ -2,16 +2,23 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2015 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- -// | Author: Haotong Lin +// | Author: liu21st // +---------------------------------------------------------------------- +/** + * 模板测试 + * @author Haotong Lin + */ + +namespace tests\thinkphp\library\think; + use think\Template; -class TemplateTest extends \PHPUnit_Framework_TestCase +class templateTest extends \PHPUnit_Framework_TestCase { public function testVar() { @@ -139,10 +146,10 @@ EOF; public function testVarIdentify() { - $config['tpl_begin'] = '<#'; - $config['tpl_end'] = '#>'; + $config['tpl_begin'] = '<#'; + $config['tpl_end'] = '#>'; $config['tpl_var_identify'] = ''; - $template = new Template($config); + $template = new Template($config); $content = <<