Changeset 6126
- Timestamp:
- 11/21/07 10:33:51 (11 months ago)
- Files:
-
- trunk/lib/routing/sfPatternRouting.class.php (modified) (1 diff)
- trunk/test/unit/routing/sfPatternRoutingTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/routing/sfPatternRouting.class.php
r5846 r6126 423 423 } 424 424 425 $params = array_merge($defaults, $params);425 $params = sfToolkit::arrayDeepMerge($defaults, $params); 426 426 427 427 $realUrl = preg_replace('/\:([^\/]+)/e', 'urlencode($params["\\1"])', $url); trunk/test/unit/routing/sfPatternRoutingTest.php
r5087 r6126 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(6 5, new lime_output_color());13 $t = new lime_test(67, new lime_output_color()); 14 14 15 15 class sfPatternRoutingTest extends sfPatternRouting … … 160 160 //$t->is($r->generate('', $params), $url, '->generate() removes the last parameter if the parameter is default value'); 161 161 162 // Numerics params 163 $r->clearRoutes(); 164 $r->connect('test', '/:module/:action/*', array('module' => 'default', 'action' => 'index')); 165 $params = array('module' => 'default', 'action' => 'index', 15 => 'foo', 32 => 'bar', 'foo' => 'bar'); 166 $url = '/default/index/15/foo/32/bar/foo/bar'; 167 $t->is($r->parse($url), $params, '->parse() routes can have numeric parameters'); 168 $t->is($r->generate('', $params), $url, '->generate() routes can have numeric parameters'); 169 170 162 171 $r->clearRoutes(); 163 172 $r->connect('test', '/:module/:action/:test/:id', array('module' => 'default', 'action' => 'index', 'test' => 'foo', 'id' => 'bar'));