新增Jump相关测试用例

This commit is contained in:
Gaozhen Ying
2017-09-08 17:18:55 +08:00
committed by ThinkPHP
parent f3a47f30ff
commit 60d6be4627
4 changed files with 342 additions and 7 deletions

View File

@@ -16,12 +16,14 @@
namespace tests\thinkphp\library\think;
use tests\thinkphp\library\think\config\ConfigInitTrait;
use think\Config;
use think\Route;
use think\Url;
class urlTest extends \PHPUnit_Framework_TestCase
{
use ConfigInitTrait;
public function setUp()
{
@@ -107,11 +109,11 @@ class urlTest extends \PHPUnit_Framework_TestCase
{
Config::set('url_domain_deploy', true);
Route::domain('subdomain.thinkphp.cn', 'admin');
$this->assertEquals('http://subdomain.thinkphp.cn/blog/10.shtml', Url::build('/blog/10'));
$this->assertEquals('http://subdomain.thinkphp.cn/blog/10.html', Url::build('/blog/10'));
Route::domain('subdomain.thinkphp.cn', [
'hello/:name' => 'index/hello',
]);
$this->assertEquals('http://subdomain.thinkphp.cn/hello/thinkphp.shtml', Url::build('index/hello?name=thinkphp'));
$this->assertEquals('http://subdomain.thinkphp.cn/hello/thinkphp.html', Url::build('index/hello?name=thinkphp'));
}
public function testRoot()