Ejemplo n.º 1
0
 /**
  * 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());
 }