summaryrefslogtreecommitdiffstats
path: root/Tests/Http
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2013-03-15 11:14:31 +0100
committerFabien Potencier <fabien.potencier@gmail.com>2013-03-15 11:14:31 +0100
commitbdbbec5781db6cd74bf74c44920ed10c0feaa344 (patch)
treeab1657378a539cb6862002c30767bb5357b865c4 /Tests/Http
parent54ec1c91bc1f7627d7ef3eaec8f8449872defc1f (diff)
parent92e984abfa1dba54b8a25e5492f7696bfaf0cb25 (diff)
downloadsymfony-security-bdbbec5781db6cd74bf74c44920ed10c0feaa344.zip
symfony-security-bdbbec5781db6cd74bf74c44920ed10c0feaa344.tar.gz
symfony-security-bdbbec5781db6cd74bf74c44920ed10c0feaa344.tar.bz2
Merge branch '2.1' into 2.2
* 2.1: sub-requests are now created with the same class as their parent [FrameworkBundle] removed BC break [FrameworkBundle] changed temp kernel name in cache:clear [DoctrineBridge] Avoids blob values to be logged by doctrine [Security] use current request attributes to generate redirect url? [Validator] fix showing wrong max file size for upload errors [TwigBridge] removed double var initialization (refs #7344) [2.1][TwigBridge] Fixes Issue #7342 in TwigBridge [FrameworkBundle] fixed cahe:clear command's warmup [TwigBridge] now enter/leave scope on Twig_Node_Module [TwigBridge] fixed fixed scope & trans_default_domain node visitor [TwigBridge] fixed non probant tests & added new one [BrowserKit] added ability to ignored malformed set-cookie header [Translation] removed wriong 'use' [Translation] added xliff loader/dumper with resname support [TwigBridge] fixes Conflicts: src/Symfony/Bundle/FrameworkBundle/HttpKernel.php src/Symfony/Component/Security/Http/HttpUtils.php src/Symfony/Component/Translation/Loader/XliffFileLoader.php src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php
Diffstat (limited to 'Tests/Http')
-rw-r--r--Tests/Http/HttpUtilsTest.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/Tests/Http/HttpUtilsTest.php b/Tests/Http/HttpUtilsTest.php
index fc1b754..8a2d2f0 100644
--- a/Tests/Http/HttpUtilsTest.php
+++ b/Tests/Http/HttpUtilsTest.php
@@ -137,13 +137,25 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase
$utils->checkRequestPath($this->getRequest(), 'foobar');
}
- private function getUrlGenerator()
+ public function testGenerateUrlRemovesQueryString()
+ {
+ $method = new \ReflectionMethod('Symfony\Component\Security\Http\HttpUtils', 'generateUrl');
+ $method->setAccessible(true);
+
+ $utils = new HttpUtils($this->getUrlGenerator());
+ $this->assertEquals('/foo/bar', $method->invoke($utils, 'route_name'));
+
+ $utils = new HttpUtils($this->getUrlGenerator('/foo/bar?param=value'));
+ $this->assertEquals('/foo/bar', $method->invoke($utils, 'route_name'));
+ }
+
+ private function getUrlGenerator($generatedUrl = '/foo/bar')
{
$urlGenerator = $this->getMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface');
$urlGenerator
->expects($this->any())
->method('generate')
- ->will($this->returnValue('/foo/bar'))
+ ->will($this->returnValue($generatedUrl))
;
return $urlGenerator;