/** * Create the full url including protocol and hostname * * @param string $uri * @param array $params * @param bool $retain Should we keep the get parameters? * @return string */ public static function full($uri = '', $params = array(), $retain = false) { return CCIn::protocol() . '://' . CCIn::host() . static::to($uri, $params, $retain); }
/** * test request method */ public function testProtocol() { // generate server data $this->fakeServerData(); $this->assertEquals(CCIn::protocol(), 'http'); $this->fakeServerData(array(), array(), array('SERVER_PORT' => '443')); $this->assertEquals(CCIn::protocol(), 'https'); $this->fakeServerData(array(), array(), array('HTTPS' => 'yes')); $this->assertEquals(CCIn::protocol(), 'https'); $this->fakeServerData(array(), array(), array('HTTPS' => 'off')); $this->assertEquals(CCIn::protocol(), 'http'); }