/** * @expectedException Gajus\Director\Exception\InvalidArgumentException * @expectedExceptionMessage Request URI does not extend the route. */ public function testGetPathRouteURINotUnderTheRoute() { $locator = new \Gajus\Director\Locator('https://gajus.com/foo/bar/'); $_SERVER['HTTPS'] = 'on'; $_SERVER['SERVER_NAME'] = 'gajus.com'; $_SERVER['REQUEST_URI'] = '/'; $locator->getPath(); $_SERVER['HTTPS'] = 'on'; $_SERVER['SERVER_NAME'] = 'gajus.com'; $_SERVER['REQUEST_URI'] = '/foo/'; $locator->getPath(); }
/** * @expectedException Gajus\Director\Exception\LogicException * @expectedExceptionMessage Redirect cannot be performed in the CLI. */ public function testCannotRedirectInCLI() { $locator = new \Gajus\Director\Locator('http://gajus.com/'); $locator->location(); }
/** * @expectedException Gajus\Director\Exception\InvalidArgumentException * @expectedExceptionMessage Path is not relative to the route. */ public function testGetURLUsingAbsoluteCustomPath() { $locator = new \Gajus\Director\Locator('http://gajus.com/'); $locator->url('/foo'); }