/** * @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); } }
public function testGetAssembledParams() { $route = new Regex('/(?<foo>.+)', '/%foo%'); $route->assemble(array('foo' => 'bar', 'baz' => 'bat')); $this->assertEquals(array('foo'), $route->getAssembledParams()); }