Development

Changeset 7611

You must first sign up to be able to contribute.

Changeset 7611

Show
Ignore:
Timestamp:
02/26/08 13:38:11 (6 months ago)
Author:
fabien
Message:

fixed empty parameters in sfPatternRouting

Files:

Legend:

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

    r7525 r7611  
    422422 
    423423      // all params must be given 
    424       if ($diff = array_diff_key($variables, array_filter($tparams))) 
     424      if ($diff = array_diff_key($variables, array_filter($tparams, create_function('$v', 'return !is_null($v);')))) 
    425425      { 
    426426        throw new InvalidArgumentException(sprintf('The "%s" route has some missing mandatory parameters (%s).', $name, implode(', ', $diff))); 
  • branches/1.1/test/unit/routing/sfPatternRoutingTest.php

    r7525 r7611  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(122, new lime_output_color()); 
     13$t = new lime_test(123, new lime_output_color()); 
    1414 
    1515class sfPatternRoutingTest extends sfPatternRouting 
     
    463463} 
    464464 
     465// parameters can be empty 
     466$t->diag('parameters can be empty'); 
     467$r->clearRoutes(); 
     468$r->connect('test', '/test/:foo/:bar'); 
     469$t->is($r->generate('test', array('foo' => 'bar', 'bar' => '')), '/test/bar/', '->generate() can take empty parameters'); 
     470 
    465471// default module/action overriding 
    466472$t->diag('module/action overriding');