public function testGetPrepareUrlOperators() { foreach (self::$urls as $url => $expected) { $result = Operators::getPrepareUrlOperators($url); $this->assertEquals($result, $expected, 'getPrepareOperators returns expected value'); } }
/** * @param array $params */ private function initParamsPortion(array $params) { $preparedUrl = Operators::getPrepareUrlOperators($this->fullUrl); $andList = array_filter(explode('|', $preparedUrl)); foreach ($andList as $and) { $orList = array_filter(explode('-', $and)); foreach ($orList as $or) { $paramKey = $this->findKeyParamByPortionString($params, $or); if ($paramKey === false) { continue; //throw new InvalidArgumentException('for portion ' . $or . ' is not set param'); } $this->paramsPortion[$paramKey] = new Portion($or); } } }