/** @internal * @brief Converts @a AfsAcpQuery to arrays of parameters. * * Retrieves parameters from query and builds appropriate parameters to be * sent to AFS ACP engine. * * @param $query [in] AfsAcpQuery to transform. * * @return array of key-value pairs where key is a valid AFS ACP query * parameter name and the associated value is a valid string for this * specific parameter name. */ private function convert_to_param(AfsAcpQuery $query) { $params = array(); foreach ($query->get_parameters() as $param => $values) { $params['afs:' . $param] = $values; } return $params; }
public function testIp() { global $_SERVER; $_SERVER = array('REMOTE_ADDR' => '127.0.0.1'); $connector = new Connector('foo', new AfsService(42)); $query = new AfsAcpQuery(); $url = $connector->build_url(null, $query->get_parameters()); $this->assertFalse(strpos($url, urlencode('afs:ip')) === False); }