/** * @test */ public function constructorParsesArgumentsWithSpecialCharactersCorrectly() { $uriString = 'http://www.neos.io/path1/?argumentäöü1=' . urlencode('valueåø€œ'); $uri = new Uri($uriString); $check = $uri->getScheme() == 'http' && $uri->getHost() == 'www.neos.io' && $uri->getPath() == '/path1/' && $uri->getQuery() == 'argumentäöü1=value%C3%A5%C3%B8%E2%82%AC%C5%93' && $uri->getArguments() == ['argumentäöü1' => 'valueåø€œ']; $this->assertTrue($check, 'The URI with special arguments has not been correctly transformed to an URI object'); }
/** * Indicates if this request has been received through a secure channel. * * @return boolean * @api */ public function isSecure() { return $this->uri->getScheme() === 'https'; }
/** * @param string|Uri $uri * @return string */ public function getScheme($uri) { if ($uri instanceof Uri) { return $uri->getScheme(); } if (preg_match(self::PATTERN_SUPPORTED_URIS, $uri, $matches) === 1) { return $matches[1]; } return ''; }