Development

#3423: sfPatternRoutingTest.patch

You must first sign up to be able to contribute.

Ticket #3423: sfPatternRoutingTest.patch

File sfPatternRoutingTest.patch, 1.6 kB (added by FabianLange, 8 months ago)

Additional unit tests exposing this bug. It can be successfuly solved by applying #3424

  • sfPatternRoutingTest.php

    old new  
    1010 
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(129, new lime_output_color()); 
     13$t = new lime_test(132, new lime_output_color()); 
    1414 
    1515class sfPatternRoutingTest extends sfPatternRouting 
    1616{ 
     
    452452$t->is($r->getCurrentInternalUri(true), '@test2?id=2', '->getCurrentInternalUri() returns the internal URI for last parsed URL'); 
    453453$t->is($r->getCurrentInternalUri(false), 'foo/bar?id=2', '->getCurrentInternalUri() returns the internal URI for last parsed URL'); 
    454454 
     455// regression for ticket #3423  occuring when cache is used. (for the test its enough to have it non null) 
     456$rCached = new sfPatternRoutingTest(new sfEventDispatcher(),new sfNoCache()); 
     457$rCached->connect('test',  '/:module', array('action' => 'index')); 
     458$rCached->connect('test2', '/', array()); 
     459$rCached->parse('/'); 
     460$t->is($rCached->getCurrentInternalUri(), 'default/index', '->getCurrentInternalUri() returns the internal URI for last parsed URL using cache'); 
     461$rCached->parse('/test'); 
     462$t->is($rCached->getCurrentInternalUri(), 'test/index', '->getCurrentInternalUri() returns the internal URI for last parsed URL using cache'); 
     463$rCached->parse('/'); 
     464$t->is($rCached->getCurrentInternalUri(), 'default/index', '->getCurrentInternalUri() returns the internal URI for last parsed URL using cache'); 
     465 
    455466// defaults 
    456467$t->diag('defaults'); 
    457468$r->clearRoutes();