From 2f726f4badb58c8b38000ff5f71ea8acd78f5bb3 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 31 Jul 2016 18:03:13 +0800 Subject: [PATCH] =?UTF-8?q?Url=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/thinkphp/library/think/urlTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/thinkphp/library/think/urlTest.php b/tests/thinkphp/library/think/urlTest.php index 2968febd..710d74f0 100644 --- a/tests/thinkphp/library/think/urlTest.php +++ b/tests/thinkphp/library/think/urlTest.php @@ -95,4 +95,15 @@ class urlTest extends \PHPUnit_Framework_TestCase ]); $this->assertEquals('http://subdomain.thinkphp.cn/hello/thinkphp.shtml', Url::build('index/hello?name=thinkphp')); } + + public function testRoot() + { + Config::set('url_domain_deploy', false); + Config::set('url_common_param', false); + Url::root('/index.php'); + Route::get(['blog', 'blog/:id'], 'index/blog'); + Config::set('url_html_suffix', 'shtml'); + $this->assertEquals('/index.php/blog/10/name/thinkphp.shtml', Url::build('blog?id=10&name=thinkphp')); + + } }