Changeset 7515
- Timestamp:
- 02/16/08 15:40:01 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/test/unit/routing/sfPatternRoutingTest.php
r7364 r7515 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(7 0, new lime_output_color());13 $t = new lime_test(73, 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 params162 // numerics params 163 163 $r->clearRoutes(); 164 164 $r->connect('test', '/:module/:action/*', array('module' => 'default', 'action' => 'index')); … … 292 292 $r->parse('/module/action/2'); 293 293 $t->is($r->getCurrentInternalUri(true), '@test2?id=2', '->getCurrentInternalUri() returns the internal URI for last parsed URL'); 294 294 295 // these tests are against r7363 295 296 $t->is($r->getCurrentInternalUri(false), 'foo/bar?id=2', '->getCurrentInternalUri() returns the internal URI for last parsed URL'); 296 297 $t->is($r->getCurrentInternalUri(true), '@test2?id=2', '->getCurrentInternalUri() returns the internal URI for last parsed URL'); 297 298 $t->is($r->getCurrentInternalUri(false), 'foo/bar?id=2', '->getCurrentInternalUri() returns the internal URI for last parsed URL'); 299 300 // defaults 301 $t->diag('defaults'); 302 $r->clearRoutes(); 303 $r->connect('test', '/test', array('module' => 'default', 'action' => 'index', 'bar' => 'foo')); 304 $params = array('module' => 'default', 'action' => 'index'); 305 $url = '/test'; 306 $t->is($r->generate('', $params), $url, '->generate() routes takes default values into account when matching a route'); 307 $params = array('module' => 'default', 'action' => 'index', 'bar' => 'foo'); 308 $t->is($r->generate('', $params), $url, '->generate() routes takes default values into account when matching a route'); 309 $params = array('module' => 'default', 'action' => 'index', 'bar' => 'bar'); 310 try 311 { 312 $r->generate('', $params); 313 $t->fail('->generate() throws a sfConfigurationException if no route matches the params'); 314 } 315 catch (sfConfigurationException $e) 316 { 317 $t->pass('->generate() throws a sfConfigurationException if no route matches the params'); 318 }