/** * @return string */ private function readPath() { $uri = $_SERVER['REQUEST_URI']; $uriWithoutScript = $this->stringUtility->substringAfter($uri, '.php'); $path = $this->stringUtility->substringBefore($uriWithoutScript, '?'); $decodedPath = urldecode($path); return $decodedPath; }
/** * @param string $string * @param string $needle * @param string $wantedResult * * @dataProvider substringBeforeDataProvider */ public function testSubstringBefore($string, $needle, $wantedResult) { $result = $this->stringUtility->substringBefore($string, $needle); $this->assertEquals($wantedResult, $result); }