本文整理汇总了PHP中JRouter::runParseRawRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP JRouter::runParseRawRoute方法的具体用法?PHP JRouter::runParseRawRoute怎么用?PHP JRouter::runParseRawRoute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRouter
的用法示例。
在下文中一共展示了JRouter::runParseRawRoute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testParseRawRoute
/**
* Tests the parse method
*
* @param string $url An associative array with variables
* @param integer $menubool JROUTER_MODE_RAW or JROUTER_MODE_SEF
* @param array $expectedVars An associative array with $_SERVER vars
* @param array $expectedGlobalVars An associative array with $_SERVER vars
*
* @return void
*
* @dataProvider casesParseRawRoute
* @since 3.4
*/
public function testParseRawRoute($url, $menubool, $expectedVars, $expectedGlobalVars)
{
$uri = new JUri($url);
if (isset($expectedGlobalVars['Itemid'])) {
$app = $this->object->getApp();
$app->input->set('Itemid', $expectedGlobalVars['Itemid']);
$this->object->setApp($app);
}
if ($menubool) {
$menu = TestMockMenu::create($this, false);
$menu->expects($this->any())->method('getDefault')->will($this->returnValue(null));
$this->object->setMenu($menu);
}
$vars = $this->object->runParseRawRoute($uri);
$this->assertEquals($expectedVars, $vars);
$this->assertEquals($expectedGlobalVars, $this->object->getVars());
}