reverts some behavior changes made in c66d1f9de30fd1b6a86cca10dd79d12c9ba9ff25

This commit is contained in:
Johannes M. Schmitt 2013-03-23 13:03:22 +01:00
parent 9e7a877f7c
commit a765375e91
2 changed files with 3 additions and 3 deletions

View File

@ -261,7 +261,7 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt
}
// add a query string if needed
$extra = array_diff_key($parameters, $variables);
$extra = array_diff_key($parameters, $variables, $defaults);
if ($extra && $query = http_build_query($extra, '', '&')) {
$url .= '?'.$query;
}

View File

@ -297,8 +297,8 @@ class UrlGeneratorTest extends \PHPUnit_Framework_TestCase
{
$routes = $this->getRoutes('test', new Route('/test', array('default' => 'value')));
$this->assertSame('/app.php/test?default=foo', $this->getGenerator($routes)->generate('test', array('default' => 'foo')));
$this->assertSame('/app.php/test?default=value', $this->getGenerator($routes)->generate('test', array('default' => 'value')));
$this->assertSame('/app.php/test', $this->getGenerator($routes)->generate('test', array('default' => 'foo')));
$this->assertSame('/app.php/test', $this->getGenerator($routes)->generate('test', array('default' => 'value')));
$this->assertSame('/app.php/test', $this->getGenerator($routes)->generate('test'));
}