diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2014-09-22 11:14:18 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2014-09-22 11:14:18 +0200 |
commit | 133d64ad84f9e37d681c70db8a05743fa2001e11 (patch) | |
tree | dcc9de2e552cb9e008b74cf7fc745e9317503a7b /Http/Tests/Firewall | |
parent | 8f099fcbce1ba9a86d5b15c5558de80a8242d91e (diff) | |
parent | 78ebbab243651e31b940cb1330b06361dbd3c37b (diff) | |
download | symfony-security-133d64ad84f9e37d681c70db8a05743fa2001e11.zip symfony-security-133d64ad84f9e37d681c70db8a05743fa2001e11.tar.gz symfony-security-133d64ad84f9e37d681c70db8a05743fa2001e11.tar.bz2 |
Merge branch '2.4' into 2.5
* 2.4:
fixed CS
[Process] fixed some volatile tests
[HttpKernel] fixed a volatile test
[HttpFoundation] fixed some volatile tests
[Tests] PHPUnit Optimizations
Use getPathname() instead of string casting to get BinaryFileReponse file path
Conflicts:
src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php
src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php
src/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php
src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php
src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php
src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php
src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php
src/Symfony/Component/Process/Tests/AbstractProcessTest.php
src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php
src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php
src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php
src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php
src/Symfony/Component/Security/Http/Tests/Firewall/SwitchUserListenerTest.php
src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php
src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php
src/Symfony/Component/Validator/Constraints/ChoiceValidator.php
src/Symfony/Component/Validator/Constraints/CollectionValidator.php
src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php
src/Symfony/Component/Validator/Tests/Constraints/IsbnValidatorTest.php
src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php
src/Symfony/Component/Yaml/Parser.php
Diffstat (limited to 'Http/Tests/Firewall')
6 files changed, 36 insertions, 36 deletions
diff --git a/Http/Tests/Firewall/AbstractPreAuthenticatedListenerTest.php b/Http/Tests/Firewall/AbstractPreAuthenticatedListenerTest.php index 57a91cf..6e34532 100644 --- a/Http/Tests/Firewall/AbstractPreAuthenticatedListenerTest.php +++ b/Http/Tests/Firewall/AbstractPreAuthenticatedListenerTest.php @@ -49,7 +49,7 @@ class AbstractPreAuthenticatedListenerTest extends \PHPUnit_Framework_TestCase $listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array( $context, $authenticationManager, - 'TheProviderKey' + 'TheProviderKey', )); $listener ->expects($this->once()) @@ -95,7 +95,7 @@ class AbstractPreAuthenticatedListenerTest extends \PHPUnit_Framework_TestCase $listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array( $context, $authenticationManager, - 'TheProviderKey' + 'TheProviderKey', )); $listener ->expects($this->once()) @@ -143,7 +143,7 @@ class AbstractPreAuthenticatedListenerTest extends \PHPUnit_Framework_TestCase $listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array( $context, $authenticationManager, - 'TheProviderKey' + 'TheProviderKey', )); $listener ->expects($this->once()) @@ -184,7 +184,7 @@ class AbstractPreAuthenticatedListenerTest extends \PHPUnit_Framework_TestCase $listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array( $context, $authenticationManager, - 'TheProviderKey' + 'TheProviderKey', )); $listener ->expects($this->once()) @@ -233,7 +233,7 @@ class AbstractPreAuthenticatedListenerTest extends \PHPUnit_Framework_TestCase $listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array( $context, $authenticationManager, - 'TheProviderKey' + 'TheProviderKey', )); $listener ->expects($this->once()) diff --git a/Http/Tests/Firewall/BasicAuthenticationListenerTest.php b/Http/Tests/Firewall/BasicAuthenticationListenerTest.php index eb51f5f..4080485 100644 --- a/Http/Tests/Firewall/BasicAuthenticationListenerTest.php +++ b/Http/Tests/Firewall/BasicAuthenticationListenerTest.php @@ -24,7 +24,7 @@ class BasicAuthenticationListenerTest extends \PHPUnit_Framework_TestCase { $request = new Request(array(), array(), array(), array(), array(), array( 'PHP_AUTH_USER' => 'TheUsername', - 'PHP_AUTH_PW' => 'ThePassword' + 'PHP_AUTH_PW' => 'ThePassword', )); $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); @@ -70,7 +70,7 @@ class BasicAuthenticationListenerTest extends \PHPUnit_Framework_TestCase { $request = new Request(array(), array(), array(), array(), array(), array( 'PHP_AUTH_USER' => 'TheUsername', - 'PHP_AUTH_PW' => 'ThePassword' + 'PHP_AUTH_PW' => 'ThePassword', )); $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); @@ -199,7 +199,7 @@ class BasicAuthenticationListenerTest extends \PHPUnit_Framework_TestCase { $request = new Request(array(), array(), array(), array(), array(), array( 'PHP_AUTH_USER' => 'TheUsername', - 'PHP_AUTH_PW' => 'ThePassword' + 'PHP_AUTH_PW' => 'ThePassword', )); $token = new PreAuthenticatedToken('TheUser', 'TheCredentials', 'TheProviderKey', array('ROLE_FOO')); diff --git a/Http/Tests/Firewall/ContextListenerTest.php b/Http/Tests/Firewall/ContextListenerTest.php index c153fd5..d6bc5b4 100644 --- a/Http/Tests/Firewall/ContextListenerTest.php +++ b/Http/Tests/Firewall/ContextListenerTest.php @@ -174,7 +174,7 @@ class ContextListenerTest extends \PHPUnit_Framework_TestCase return array( array(serialize(new \__PHP_Incomplete_Class())), array(serialize(null)), - array(null) + array(null), ); } diff --git a/Http/Tests/Firewall/DigestDataTest.php b/Http/Tests/Firewall/DigestDataTest.php index 86a5327..a7c8d49 100644 --- a/Http/Tests/Firewall/DigestDataTest.php +++ b/Http/Tests/Firewall/DigestDataTest.php @@ -18,9 +18,9 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase public function testGetResponse() { $digestAuth = new DigestData( - 'username="user", realm="Welcome, robot!", ' . - 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="user", realm="Welcome, robot!", '. + 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -30,9 +30,9 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase public function testGetUsername() { $digestAuth = new DigestData( - 'username="user", realm="Welcome, robot!", ' . - 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="user", realm="Welcome, robot!", '. + 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -42,9 +42,9 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase public function testGetUsernameWithQuote() { $digestAuth = new DigestData( - 'username="\"user\"", realm="Welcome, robot!", ' . - 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="\"user\"", realm="Welcome, robot!", '. + 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -54,9 +54,9 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase public function testGetUsernameWithQuoteAndEscape() { $digestAuth = new DigestData( - 'username="\"u\\\\\"ser\"", realm="Welcome, robot!", ' . - 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="\"u\\\\\"ser\"", realm="Welcome, robot!", '. + 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -66,9 +66,9 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase public function testGetUsernameWithSingleQuote() { $digestAuth = new DigestData( - 'username="\"u\'ser\"", realm="Welcome, robot!", ' . - 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="\"u\'ser\"", realm="Welcome, robot!", '. + 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -78,9 +78,9 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase public function testGetUsernameWithSingleQuoteAndEscape() { $digestAuth = new DigestData( - 'username="\"u\\\'ser\"", realm="Welcome, robot!", ' . - 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="\"u\\\'ser\"", realm="Welcome, robot!", '. + 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -90,9 +90,9 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase public function testGetUsernameWithEscape() { $digestAuth = new DigestData( - 'username="\"u\\ser\"", realm="Welcome, robot!", ' . - 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="\"u\\ser\"", realm="Welcome, robot!", '. + 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -106,8 +106,8 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase $nonce = base64_encode($time.':'.md5($time.':'.$key)); $digestAuth = new DigestData( - 'username="user", realm="Welcome, robot!", nonce="'.$nonce.'", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="user", realm="Welcome, robot!", nonce="'.$nonce.'", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -146,8 +146,8 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase $nonce = base64_encode($time.':'.md5($time.':'.$key)); $digestAuth = new DigestData( - 'username="user", realm="Welcome, robot!", nonce="'.$nonce.'", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="user", realm="Welcome, robot!", nonce="'.$nonce.'", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); diff --git a/Http/Tests/Firewall/SwitchUserListenerTest.php b/Http/Tests/Firewall/SwitchUserListenerTest.php index 110e05c..9e149a2 100644 --- a/Http/Tests/Firewall/SwitchUserListenerTest.php +++ b/Http/Tests/Firewall/SwitchUserListenerTest.php @@ -157,7 +157,7 @@ class SwitchUserListenerTest extends \PHPUnit_Framework_TestCase $this->securityContext->expects($this->any())->method('getToken')->will($this->returnValue($token)); $this->request->expects($this->any())->method('get')->with('_switch_user')->will($this->returnValue('kuba')); $this->request->query->expects($this->once())->method('remove', '_switch_user'); - $this->request->query->expects($this->any())->method('all')->will($this->returnValue(array('page'=>3,'section'=>2))); + $this->request->query->expects($this->any())->method('all')->will($this->returnValue(array('page' => 3,'section' => 2))); $this->request->expects($this->any())->method('getUri')->will($this->returnValue('/')); $this->request->server->expects($this->once())->method('set')->with('QUERY_STRING', 'page=3§ion=2'); diff --git a/Http/Tests/Firewall/X509AuthenticationListenerTest.php b/Http/Tests/Firewall/X509AuthenticationListenerTest.php index 7eefb30..7f2da3e 100644 --- a/Http/Tests/Firewall/X509AuthenticationListenerTest.php +++ b/Http/Tests/Firewall/X509AuthenticationListenerTest.php @@ -106,7 +106,7 @@ class X509AuthenticationListenerTest extends \PHPUnit_Framework_TestCase $request = new Request(array(), array(), array(), array(), array(), array( 'TheUserKey' => 'TheUser', - 'TheCredentialsKey' => 'TheCredentials' + 'TheCredentialsKey' => 'TheCredentials', )); $context = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface'); |