Skip to content

Commit 0ddca63

Browse files
committed
Merge branch '2.5'
* 2.5: added missing use statements added missing use statement added missing use statement 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/ConfigurationTest.php src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php src/Symfony/Component/Process/Process.php src/Symfony/Component/Stopwatch/Stopwatch.php src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php src/Symfony/Component/Yaml/Parser.php src/Symfony/Component/Yaml/Tests/InlineTest.php
2 parents 168fbe9 + 5d99ace commit 0ddca63

16 files changed

+51
-51
lines changed

Authentication/AuthenticationUtils.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public function getLastAuthenticationError($clearSession = true)
5454
if ($clearSession) {
5555
$session->remove(SecurityContextInterface::AUTHENTICATION_ERROR);
5656
}
57-
5857
}
5958

6059
return $authenticationException;

Authentication/DefaultAuthenticationFailureHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct(HttpKernelInterface $httpKernel, HttpUtils $httpUtil
5353
'failure_path' => null,
5454
'failure_forward' => false,
5555
'login_path' => '/login',
56-
'failure_path_parameter' => '_failure_path'
56+
'failure_path_parameter' => '_failure_path',
5757
), $options);
5858
}
5959

@@ -63,7 +63,7 @@ public function __construct(HttpKernelInterface $httpKernel, HttpUtils $httpUtil
6363
public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
6464
{
6565
if ($failureUrl = $request->get($this->options['failure_path_parameter'], null, true)) {
66-
$this->options['failure_path'] = $failureUrl;
66+
$this->options['failure_path'] = $failureUrl;
6767
}
6868

6969
if (null === $this->options['failure_path']) {

RememberMe/TokenBasedRememberMeServices.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ protected function generateCookieValue($class, $username, $expires, $password)
105105
$class,
106106
base64_encode($username),
107107
$expires,
108-
$this->generateCookieHash($class, $username, $expires, $password)
108+
$this->generateCookieHash($class, $username, $expires, $password),
109109
));
110110
}
111111

Tests/Authentication/DefaultAuthenticationSuccessHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testDefaultTargetPathCanBeForced()
4343
{
4444
$options = array(
4545
'always_use_default_target_path' => true,
46-
'default_target_path' => '/dashboard'
46+
'default_target_path' => '/dashboard',
4747
);
4848

4949
$response = $this->expectRedirectResponse('/dashboard');

Tests/EntryPoint/RetryAuthenticationEntryPointTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,26 @@ public function dataForStart()
3939
80,
4040
443,
4141
Request::create('http://localhost/foo/bar?baz=bat'),
42-
'https://localhost/foo/bar?baz=bat'
42+
'https://localhost/foo/bar?baz=bat',
4343
),
4444
array(
4545
80,
4646
443,
4747
Request::create('https://localhost/foo/bar?baz=bat'),
48-
'http://localhost/foo/bar?baz=bat'
48+
'http://localhost/foo/bar?baz=bat',
4949
),
5050
array(
5151
80,
5252
123,
5353
Request::create('http://localhost/foo/bar?baz=bat'),
54-
'https://localhost:123/foo/bar?baz=bat'
54+
'https://localhost:123/foo/bar?baz=bat',
5555
),
5656
array(
5757
8080,
5858
443,
5959
Request::create('https://localhost/foo/bar?baz=bat'),
60-
'http://localhost:8080/foo/bar?baz=bat'
61-
)
60+
'http://localhost:8080/foo/bar?baz=bat',
61+
),
6262
);
6363
}
6464
}

Tests/Firewall/AbstractPreAuthenticatedListenerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testHandleWithValidValues()
4949
$listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array(
5050
$context,
5151
$authenticationManager,
52-
'TheProviderKey'
52+
'TheProviderKey',
5353
));
5454
$listener
5555
->expects($this->once())
@@ -95,7 +95,7 @@ public function testHandleWhenAuthenticationFails()
9595
$listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array(
9696
$context,
9797
$authenticationManager,
98-
'TheProviderKey'
98+
'TheProviderKey',
9999
));
100100
$listener
101101
->expects($this->once())
@@ -143,7 +143,7 @@ public function testHandleWhenAuthenticationFailsWithDifferentToken()
143143
$listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array(
144144
$context,
145145
$authenticationManager,
146-
'TheProviderKey'
146+
'TheProviderKey',
147147
));
148148
$listener
149149
->expects($this->once())
@@ -184,7 +184,7 @@ public function testHandleWithASimilarAuthenticatedToken()
184184
$listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array(
185185
$context,
186186
$authenticationManager,
187-
'TheProviderKey'
187+
'TheProviderKey',
188188
));
189189
$listener
190190
->expects($this->once())
@@ -233,7 +233,7 @@ public function testHandleWithAnInvalidSimilarToken()
233233
$listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array(
234234
$context,
235235
$authenticationManager,
236-
'TheProviderKey'
236+
'TheProviderKey',
237237
));
238238
$listener
239239
->expects($this->once())

Tests/Firewall/BasicAuthenticationListenerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function testHandleWithValidUsernameAndPasswordServerParameters()
2424
{
2525
$request = new Request(array(), array(), array(), array(), array(), array(
2626
'PHP_AUTH_USER' => 'TheUsername',
27-
'PHP_AUTH_PW' => 'ThePassword'
27+
'PHP_AUTH_PW' => 'ThePassword',
2828
));
2929

3030
$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
@@ -70,7 +70,7 @@ public function testHandleWhenAuthenticationFails()
7070
{
7171
$request = new Request(array(), array(), array(), array(), array(), array(
7272
'PHP_AUTH_USER' => 'TheUsername',
73-
'PHP_AUTH_PW' => 'ThePassword'
73+
'PHP_AUTH_PW' => 'ThePassword',
7474
));
7575

7676
$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
@@ -199,7 +199,7 @@ public function testHandleWithADifferentAuthenticatedToken()
199199
{
200200
$request = new Request(array(), array(), array(), array(), array(), array(
201201
'PHP_AUTH_USER' => 'TheUsername',
202-
'PHP_AUTH_PW' => 'ThePassword'
202+
'PHP_AUTH_PW' => 'ThePassword',
203203
));
204204

205205
$token = new PreAuthenticatedToken('TheUser', 'TheCredentials', 'TheProviderKey', array('ROLE_FOO'));

Tests/Firewall/ContextListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public function provideInvalidToken()
174174
return array(
175175
array(serialize(new \__PHP_Incomplete_Class())),
176176
array(serialize(null)),
177-
array(null)
177+
array(null),
178178
);
179179
}
180180

Tests/Firewall/DigestDataTest.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase
1818
public function testGetResponse()
1919
{
2020
$digestAuth = new DigestData(
21-
'username="user", realm="Welcome, robot!", ' .
22-
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' .
23-
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' .
21+
'username="user", realm="Welcome, robot!", '.
22+
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '.
23+
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
2424
'response="b52938fc9e6d7c01be7702ece9031b42"'
2525
);
2626

@@ -30,9 +30,9 @@ public function testGetResponse()
3030
public function testGetUsername()
3131
{
3232
$digestAuth = new DigestData(
33-
'username="user", realm="Welcome, robot!", ' .
34-
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' .
35-
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' .
33+
'username="user", realm="Welcome, robot!", '.
34+
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '.
35+
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
3636
'response="b52938fc9e6d7c01be7702ece9031b42"'
3737
);
3838

@@ -42,9 +42,9 @@ public function testGetUsername()
4242
public function testGetUsernameWithQuote()
4343
{
4444
$digestAuth = new DigestData(
45-
'username="\"user\"", realm="Welcome, robot!", ' .
46-
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' .
47-
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' .
45+
'username="\"user\"", realm="Welcome, robot!", '.
46+
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '.
47+
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
4848
'response="b52938fc9e6d7c01be7702ece9031b42"'
4949
);
5050

@@ -54,9 +54,9 @@ public function testGetUsernameWithQuote()
5454
public function testGetUsernameWithQuoteAndEscape()
5555
{
5656
$digestAuth = new DigestData(
57-
'username="\"u\\\\\"ser\"", realm="Welcome, robot!", ' .
58-
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' .
59-
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' .
57+
'username="\"u\\\\\"ser\"", realm="Welcome, robot!", '.
58+
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '.
59+
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
6060
'response="b52938fc9e6d7c01be7702ece9031b42"'
6161
);
6262

@@ -66,9 +66,9 @@ public function testGetUsernameWithQuoteAndEscape()
6666
public function testGetUsernameWithSingleQuote()
6767
{
6868
$digestAuth = new DigestData(
69-
'username="\"u\'ser\"", realm="Welcome, robot!", ' .
70-
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' .
71-
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' .
69+
'username="\"u\'ser\"", realm="Welcome, robot!", '.
70+
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '.
71+
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
7272
'response="b52938fc9e6d7c01be7702ece9031b42"'
7373
);
7474

@@ -78,9 +78,9 @@ public function testGetUsernameWithSingleQuote()
7878
public function testGetUsernameWithSingleQuoteAndEscape()
7979
{
8080
$digestAuth = new DigestData(
81-
'username="\"u\\\'ser\"", realm="Welcome, robot!", ' .
82-
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' .
83-
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' .
81+
'username="\"u\\\'ser\"", realm="Welcome, robot!", '.
82+
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '.
83+
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
8484
'response="b52938fc9e6d7c01be7702ece9031b42"'
8585
);
8686

@@ -90,9 +90,9 @@ public function testGetUsernameWithSingleQuoteAndEscape()
9090
public function testGetUsernameWithEscape()
9191
{
9292
$digestAuth = new DigestData(
93-
'username="\"u\\ser\"", realm="Welcome, robot!", ' .
94-
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' .
95-
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' .
93+
'username="\"u\\ser\"", realm="Welcome, robot!", '.
94+
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '.
95+
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
9696
'response="b52938fc9e6d7c01be7702ece9031b42"'
9797
);
9898

@@ -106,8 +106,8 @@ public function testValidateAndDecode()
106106
$nonce = base64_encode($time.':'.md5($time.':'.$key));
107107

108108
$digestAuth = new DigestData(
109-
'username="user", realm="Welcome, robot!", nonce="'.$nonce.'", ' .
110-
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' .
109+
'username="user", realm="Welcome, robot!", nonce="'.$nonce.'", '.
110+
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
111111
'response="b52938fc9e6d7c01be7702ece9031b42"'
112112
);
113113

@@ -146,8 +146,8 @@ public function testIsNonceExpired()
146146
$nonce = base64_encode($time.':'.md5($time.':'.$key));
147147

148148
$digestAuth = new DigestData(
149-
'username="user", realm="Welcome, robot!", nonce="'.$nonce.'", ' .
150-
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' .
149+
'username="user", realm="Welcome, robot!", nonce="'.$nonce.'", '.
150+
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
151151
'response="b52938fc9e6d7c01be7702ece9031b42"'
152152
);
153153

Tests/Firewall/SwitchUserListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function testSwitchUserKeepsOtherQueryStringParameters()
157157
$this->securityContext->expects($this->any())->method('getToken')->will($this->returnValue($token));
158158
$this->request->expects($this->any())->method('get')->with('_switch_user')->will($this->returnValue('kuba'));
159159
$this->request->query->expects($this->once())->method('remove', '_switch_user');
160-
$this->request->query->expects($this->any())->method('all')->will($this->returnValue(array('page'=>3,'section'=>2)));
160+
$this->request->query->expects($this->any())->method('all')->will($this->returnValue(array('page' => 3,'section' => 2)));
161161
$this->request->expects($this->any())->method('getUri')->will($this->returnValue('/'));
162162
$this->request->server->expects($this->once())->method('set')->with('QUERY_STRING', 'page=3&section=2');
163163

Tests/Firewall/X509AuthenticationListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function testGetPreAuthenticatedDataWithDifferentKeys()
106106

107107
$request = new Request(array(), array(), array(), array(), array(), array(
108108
'TheUserKey' => 'TheUser',
109-
'TheCredentialsKey' => 'TheCredentials'
109+
'TheCredentialsKey' => 'TheCredentials',
110110
));
111111
$context = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface');
112112

Tests/FirewallTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function testOnKernelRequestStopsWhenThereIsAResponse()
7373
array(
7474
$this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'),
7575
$this->getMock('Symfony\Component\HttpFoundation\Request', array(), array(), '', false, false),
76-
HttpKernelInterface::MASTER_REQUEST
76+
HttpKernelInterface::MASTER_REQUEST,
7777
)
7878
);
7979
$event

Tests/HttpUtilsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function provideSecurityContextAttributes()
128128
return array(
129129
array(SecurityContextInterface::AUTHENTICATION_ERROR),
130130
array(SecurityContextInterface::ACCESS_DENIED_ERROR),
131-
array(SecurityContextInterface::LAST_USERNAME)
131+
array(SecurityContextInterface::LAST_USERNAME),
132132
);
133133
}
134134

Tests/RememberMe/AbstractRememberMeServicesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ protected function getService($userProvider = null, $options = array(), $logger
243243
}
244244

245245
return $this->getMockForAbstractClass('Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices', array(
246-
array($userProvider), 'fookey', 'fookey', $options, $logger
246+
array($userProvider), 'fookey', 'fookey', $options, $logger,
247247
));
248248
}
249249

Tests/RememberMe/PersistentTokenBasedRememberMeServicesTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ public function testAutoLoginThrowsExceptionOnStolenCookieAndRemovesItFromThePer
117117
try {
118118
$service->autoLogin($request);
119119
$this->fail('Expected CookieTheftException was not thrown.');
120-
} catch (CookieTheftException $theft) { }
120+
} catch (CookieTheftException $theft) {
121+
}
121122

122123
$this->assertTrue($request->attributes->has(RememberMeServicesInterface::COOKIE_ATTR_NAME));
123124
}

Tests/RememberMe/ResponseListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function testRememberMeCookieIsSentWithResponse()
2424
$cookie = new Cookie('rememberme');
2525

2626
$request = $this->getRequest(array(
27-
RememberMeServicesInterface::COOKIE_ATTR_NAME => $cookie
27+
RememberMeServicesInterface::COOKIE_ATTR_NAME => $cookie,
2828
));
2929

3030
$response = $this->getResponse();

0 commit comments

Comments
 (0)