Changeset 6125
- Timestamp:
- 11/21/07 10:16:20 (2 years ago)
- Files:
-
- branches/1.0/lib/controller/sfRouting.class.php (modified) (1 diff)
- branches/1.0/test/unit/controller/sfRoutingTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/lib/controller/sfRouting.class.php
r5845 r6125 456 456 } 457 457 458 $params = array_merge($defaults, $params);458 $params = sfToolkit::arrayDeepMerge($defaults, $params); 459 459 460 460 $real_url = preg_replace('/\:([^\/]+)/e', 'urlencode($params["\\1"])', $url); branches/1.0/test/unit/controller/sfRoutingTest.php
r4228 r6125 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(6 6, new lime_output_color());13 $t = new lime_test(68, new lime_output_color()); 14 14 15 15 // public methods … … 177 177 //$t->is($r->generate('', $params), $url, '->generate() removes last parameters if they have default values'); 178 178 179 // Numerics params 180 $r->clearRoutes(); 181 $r->connect('test', '/:module/:action/*', array('module' => 'default', 'action' => 'index')); 182 $params = array('module' => 'default', 'action' => 'index', 15 => 'foo', 32 => 'bar', 'foo' => 'bar'); 183 $url = '/default/index/15/foo/32/bar/foo/bar'; 184 $t->is($r->parse($url), $params, '->parse() routes can have numeric parameters'); 185 $t->is($r->generate('', $params), $url, '->generate() routes can have numeric parameters'); 186 179 187 // star parameter 180 188 $r->clearRoutes();

