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()); }
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)); }