本文整理匯總了PHP中TYPO3\CMS\Core\Tests\AccessibleObjectInterface::getQueryArguments方法的典型用法代碼示例。如果您正苦於以下問題:PHP AccessibleObjectInterface::getQueryArguments方法的具體用法?PHP AccessibleObjectInterface::getQueryArguments怎麽用?PHP AccessibleObjectInterface::getQueryArguments使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TYPO3\CMS\Core\Tests\AccessibleObjectInterface
的用法示例。
在下文中一共展示了AccessibleObjectInterface::getQueryArguments方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getQueryArgumentsWithMethodGetPostMergesParameters
/**
* @test
*/
public function getQueryArgumentsWithMethodGetPostMergesParameters() {
$_GET = array(
'key1' => 'GET1',
'key2' => 'GET2',
'key3' => array(
'key31' => 'GET31',
'key32' => 'GET32',
'key33' => array(
'key331' => 'GET331',
'key332' => 'GET332',
)
)
);
$_POST = array(
'key2' => 'POST2',
'key3' => array(
'key32' => 'POST32',
'key33' => array(
'key331' => 'POST331',
)
)
);
$getQueryArgumentsConfiguration = array();
$getQueryArgumentsConfiguration['method'] = 'GET,POST';
$expectedResult = $this->rawUrlEncodeSquareBracketsInUrl('&key1=GET1&key2=POST2&key3[key31]=GET31&key3[key32]=POST32&key3[key33][key331]=POST331&key3[key33][key332]=GET332');
$actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration);
$this->assertEquals($expectedResult, $actualResult);
}
示例2: getQueryArgumentsOverrulesMultiDimensionalForcedParameters
/**
* @test
*/
public function getQueryArgumentsOverrulesMultiDimensionalForcedParameters()
{
$_SERVER['QUERY_STRING'] = 'key1=value1' . '&key2=value2' . '&key3[key31]=value31' . '&key3[key32][key321]=value321' . '&key3[key32][key322]=value322';
$_POST = array('key1' => 'value1', 'key2' => 'value2', 'key3' => array('key31' => 'value31', 'key32' => array('key321' => 'value321', 'key322' => 'value322')));
$getQueryArgumentsConfiguration = array();
$getQueryArgumentsConfiguration['exclude'] = array();
$getQueryArgumentsConfiguration['exclude'][] = 'key1';
$getQueryArgumentsConfiguration['exclude'][] = 'key3[key31]';
$getQueryArgumentsConfiguration['exclude'][] = 'key3[key32][key321]';
$getQueryArgumentsConfiguration['exclude'][] = 'key3[key32][key322]';
$getQueryArgumentsConfiguration['exclude'] = implode(',', $getQueryArgumentsConfiguration['exclude']);
$overruleArguments = array('key2' => 'value2Overruled', 'key3' => array('key32' => array('key321' => 'value321Overruled', 'key323' => 'value323Overruled')));
$expectedResult = $this->rawUrlEncodeSquareBracketsInUrl('&key2=value2Overruled&key3[key32][key321]=value321Overruled&key3[key32][key323]=value323Overruled');
$actualResult = $this->cObj->getQueryArguments($getQueryArgumentsConfiguration, $overruleArguments, TRUE);
$this->assertEquals($expectedResult, $actualResult);
$getQueryArgumentsConfiguration['method'] = 'POST';
$actualResult = $this->cObj->getQueryArguments($getQueryArgumentsConfiguration, $overruleArguments, TRUE);
$this->assertEquals($expectedResult, $actualResult);
}