Development

Changeset 4899

You must first sign up to be able to contribute.

Changeset 4899

Show
Ignore:
Timestamp:
08/25/07 19:07:06 (1 year ago)
Author:
fabien
Message:

fixed typo in routing (closes #2133)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/routing/sfPatternRouting.class.php

    r4894 r4899  
    9393      foreach ($names as $name) 
    9494      { 
    95         if ($name == 'module' || $name == 'action') continue; 
    96  
    97         $params[] = $name.'='.isset($parameters[$name]) ? $parameters[$name] : (isset($defaults[$name]) ? $defaults[$name] : ''); 
     95        if ($name == 'module' || $name == 'action') 
     96        { 
     97          continue; 
     98        } 
     99 
     100        $params[] = $name.'='.(isset($parameters[$name]) ? $parameters[$name] : (isset($defaults[$name]) ? $defaults[$name] : '')); 
    98101      } 
    99102 
  • trunk/test/unit/routing/sfPatternRoutingTest.php

    r4892 r4899  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(63, new lime_output_color()); 
     13$t = new lime_test(64, new lime_output_color()); 
    1414 
    1515class sfPatternRoutingTest extends sfPatternRouting 
     
    267267$t->diag('->getCurrentInternalUri()'); 
    268268$r->clearRoutes(); 
     269$r->connect('test2', '/module/action/:id', array('module' => 'foo', 'action' => 'bar')); 
    269270$r->connect('test',  '/:module', array('action' => 'index')); 
    270271$r->connect('test1', '/:module/:action/*', array()); 
     
    273274$r->parse('/foo/bar/bar/foo/a/b'); 
    274275$t->is($r->getCurrentInternalUri(), 'foo/bar?a=b&bar=foo', '->getCurrentInternalUri() returns the internal URI for last parsed URL'); 
     276$r->parse('/module/action/2'); 
     277$t->is($r->getCurrentInternalUri(true), '@test2?id=2', '->getCurrentInternalUri() returns the internal URI for last parsed URL');