コード例 #1
0
 /**
  * Tests the Joomla\Router\Router::addMap method.
  *
  * @return  void
  *
  * @covers  Joomla\Router\Router::addMap
  * @since   1.0
  */
 public function testAddMap()
 {
     $this->assertAttributeEmpty('maps', $this->instance);
     $this->instance->addMap('foo', 'MyApplicationFoo');
     $this->assertAttributeEquals(array(array('regex' => chr(1) . '^foo$' . chr(1), 'vars' => array(), 'controller' => 'MyApplicationFoo')), 'maps', $this->instance);
 }
コード例 #2
0
ファイル: RouterTest.php プロジェクト: chrisdavenport/router
 /**
  * Tests the Joomla\Router\Router::addMap method.
  *
  * @param   string  $route       The route pattern to use for matching.
  * @param   string  $controller  The controller name to map to the given pattern.
  * @param   string  $regex       The generated regex to match.
  * @param   array   $vars        Variables captured from route
  * @param   string  $called      Controller called.
  *
  * @return  void
  *
  * @covers        Joomla\Router\Router::addMap
  * @dataProvider  dataAddMap
  * @since         1.0
  */
 public function testAddMap($route, $controller, $regex, $vars, $called)
 {
     $this->instance->addMap($route, $controller);
     $this->assertContains(array('regex' => chr(1) . $regex . chr(1), 'vars' => $vars, 'controller' => $called), TestHelper::getValue($this->instance, 'maps'));
 }