本文整理汇总了PHP中JRouter::runBuildRawRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP JRouter::runBuildRawRoute方法的具体用法?PHP JRouter::runBuildRawRoute怎么用?PHP JRouter::runBuildRawRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRouter
的用法示例。
在下文中一共展示了JRouter::runBuildRawRoute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testBuildRawRoute
/**
* Tests the buildRawRoute() method
*
* @return void
*
* @since 3.4
*/
public function testBuildRawRoute()
{
$uri = new JUri('index.php');
// Test if a URL without an option is returned identical
$this->object->runBuildRawRoute($uri);
$this->assertEquals('index.php', $uri->toString());
// Test if a component routers preprocess method is executed
$uri->setVar('option', 'com_test');
$this->object->runBuildRawRoute($uri);
$this->assertEquals('index.php?option=com_test&testvar=testvalue', $uri->toString());
// Test if a broken option is properly sanitised to get the right router
$uri->setVar('option', 'com_ te?st');
$uri->delVar('testvar');
$this->object->runBuildRawRoute($uri);
$this->assertEquals('index.php?option=com_ te?st&testvar=testvalue', $uri->toString());
// Test if a legacy component routers preprocess method is executed
$uri->setVar('option', 'com_test3');
$uri->delVar('testvar');
$this->object->runBuildRawRoute($uri);
$this->assertEquals('index.php?option=com_test3', $uri->toString());
}