Changeset 10591
- Timestamp:
- 08/01/08 18:01:43 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/routing/sfPatternRouting.class.php
r10199 r10591 559 559 // replace variables 560 560 $realUrl = $url; 561 foreach ($variables as $variable => $value) 561 562 $tmp = $variables; 563 uasort($tmp, create_function('$a, $b', 'return strlen($a) < strlen($b);')); 564 foreach ($tmp as $variable => $value) 562 565 { 563 566 $realUrl = str_replace($value, urlencode($tparams[$variable]), $realUrl); branches/1.1/test/unit/routing/sfPatternRoutingTest.php
r8806 r10591 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(13 5, new lime_output_color());13 $t = new lime_test(136, new lime_output_color()); 14 14 15 15 class sfPatternRoutingTest extends sfPatternRouting … … 537 537 $params = array('module' => 'default', 'action' => 'action', 'param1' => 'param1'); 538 538 $t->is($r->parse($url), $params, 'parse /customer/:param1/:action/* route'); 539 540 $r->clearRoutes(); 541 $r->connect('test', '/customer/:id/:id_name', array('module' => 'default')); 542 $t->is($r->generate('', array('id' => 2, 'id_name' => 'fabien')), '/customer/2/fabien', '->generate() first replaces the longest variable names');

