예제 #1
0
 /**
  * @dataProvider routeProvider
  * @param        Regex   $route
  * @param        string  $path
  * @param        integer $offset
  * @param        array   $params
  */
 public function testAssembling(Regex $route, $path, $offset, array $params = null)
 {
     if ($params === null) {
         // Data which will not match are not tested for assembling.
         return;
     }
     $result = $route->assemble($params);
     if ($offset !== null) {
         $this->assertEquals($offset, strpos($path, $result, $offset));
     } else {
         $this->assertEquals($path, $result);
     }
 }
예제 #2
0
파일: RegexTest.php 프로젝트: nieldm/zf2
 public function testGetAssembledParams()
 {
     $route = new Regex('/(?<foo>.+)', '/%foo%');
     $route->assemble(array('foo' => 'bar', 'baz' => 'bat'));
     $this->assertEquals(array('foo'), $route->getAssembledParams());
 }