/** * Test domain retrieval. * * @return void */ public function testDomain() { $_SERVER['HTTP_HOST'] = 'something.example.com'; $request = new CakeRequest('some/path'); $this->assertEquals('example.com', $request->domain()); $_SERVER['HTTP_HOST'] = 'something.example.co.uk'; $this->assertEquals('example.co.uk', $request->domain(2)); }
/** * Get domain name * * @return string */ protected function _getDomain() { return $this->Request->domain(self::$_tldLength); }