コード例 #1
0
ファイル: UriTest.php プロジェクト: dotronglong/titan-http
 public function testBaseUrlAndPath()
 {
     $uri = new Uri();
     $uri->setBaseUrl('/folder/');
     $uri->setPath('/folder/my-path');
     $this->assertEquals('/my-path', $uri->getPath());
     $this->assertEquals('/folder', $uri->getBaseUrl());
 }
コード例 #2
0
 public function testMatchInvalidString()
 {
     $host = '{lang}.domain.com.{country}';
     $path = '/account/{id}';
     $route = new RegexRoute('sample', $host, $path, ['GET', 'POST'], ['country' => 'us|jp']);
     $uri = new Uri();
     $uri->setHost('en.domain.com.vi')->setPath('/account/1988');
     $request = new Request();
     $request->setUri($uri);
     $this->assertFalse($route->match($request));
 }