Skip to content

Commit 1cb3dab

Browse files
committed
Merge branch '2.4'
* 2.4: fixed various inconsistencies reduced recursion when building DumperPrefixCollection renamed variables - making next change more readable removing dead code. [ExpressionLanguage] added some tests for the built-in constant() function [ExpressionLanguage] added some documentation about functions [DomCrawler] Fixed filterXPath() chaining [DomCrawler] Fixed incorrect handling of image inputs
2 parents a22cc49 + f89d3aa commit 1cb3dab

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

Tests/Authentication/Provider/DaoAuthenticationProviderTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function testCheckAuthenticationWhenCredentialsAreEmpty()
115115
->method('isPasswordValid')
116116
;
117117

118-
$provider = $this->getProvider(false, false, $encoder);
118+
$provider = $this->getProvider(null, null, $encoder);
119119
$method = new \ReflectionMethod($provider, 'checkAuthentication');
120120
$method->setAccessible(true);
121121

@@ -142,7 +142,7 @@ public function testCheckAuthenticationWhenCredentialsAre0()
142142
->will($this->returnValue(true))
143143
;
144144

145-
$provider = $this->getProvider(false, false, $encoder);
145+
$provider = $this->getProvider(null, null, $encoder);
146146
$method = new \ReflectionMethod($provider, 'checkAuthentication');
147147
$method->setAccessible(true);
148148

@@ -171,7 +171,7 @@ public function testCheckAuthenticationWhenCredentialsAreNotValid()
171171
->will($this->returnValue(false))
172172
;
173173

174-
$provider = $this->getProvider(false, false, $encoder);
174+
$provider = $this->getProvider(null, null, $encoder);
175175
$method = new \ReflectionMethod($provider, 'checkAuthentication');
176176
$method->setAccessible(true);
177177

@@ -206,7 +206,7 @@ public function testCheckAuthenticationDoesNotReauthenticateWhenPasswordHasChang
206206
->will($this->returnValue('newFoo'))
207207
;
208208

209-
$provider = $this->getProvider(false, false, null);
209+
$provider = $this->getProvider();
210210
$reflection = new \ReflectionMethod($provider, 'checkAuthentication');
211211
$reflection->setAccessible(true);
212212
$reflection->invoke($provider, $dbUser, $token);
@@ -231,7 +231,7 @@ public function testCheckAuthenticationWhenTokenNeedsReauthenticationWorksWithou
231231
->will($this->returnValue('foo'))
232232
;
233233

234-
$provider = $this->getProvider(false, false, null);
234+
$provider = $this->getProvider();
235235
$reflection = new \ReflectionMethod($provider, 'checkAuthentication');
236236
$reflection->setAccessible(true);
237237
$reflection->invoke($provider, $dbUser, $token);
@@ -245,7 +245,7 @@ public function testCheckAuthentication()
245245
->will($this->returnValue(true))
246246
;
247247

248-
$provider = $this->getProvider(false, false, $encoder);
248+
$provider = $this->getProvider(null, null, $encoder);
249249
$method = new \ReflectionMethod($provider, 'checkAuthentication');
250250
$method->setAccessible(true);
251251

@@ -270,17 +270,17 @@ protected function getSupportedToken()
270270
return $mock;
271271
}
272272

273-
protected function getProvider($user = false, $userChecker = false, $passwordEncoder = null)
273+
protected function getProvider($user = null, $userChecker = null, $passwordEncoder = null)
274274
{
275275
$userProvider = $this->getMock('Symfony\\Component\\Security\\Core\\User\\UserProviderInterface');
276-
if (false !== $user) {
276+
if (null !== $user) {
277277
$userProvider->expects($this->once())
278278
->method('loadUserByUsername')
279279
->will($this->returnValue($user))
280280
;
281281
}
282282

283-
if (false === $userChecker) {
283+
if (null === $userChecker) {
284284
$userChecker = $this->getMock('Symfony\\Component\\Security\\Core\\User\\UserCheckerInterface');
285285
}
286286

Tests/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,17 @@ protected function getSupportedToken($user = false, $credentials = false)
114114
return $token;
115115
}
116116

117-
protected function getProvider($user = false, $userChecker = false)
117+
protected function getProvider($user = null, $userChecker = null)
118118
{
119119
$userProvider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface');
120-
if (false !== $user) {
120+
if (null !== $user) {
121121
$userProvider->expects($this->once())
122122
->method('loadUserByUsername')
123123
->will($this->returnValue($user))
124124
;
125125
}
126126

127-
if (false === $userChecker) {
127+
if (null === $userChecker) {
128128
$userChecker = $this->getMock('Symfony\Component\Security\Core\User\UserCheckerInterface');
129129
}
130130

Tests/Util/SecureRandomTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ public function testLongRun($secureRandom)
111111
{
112112
$b = $this->getBitSequence($secureRandom, 20000);
113113

114-
$longestRun = 0;
115-
$currentRun = $lastBit = null;
114+
$longestRun = $currentRun = 0;
115+
$lastBit = null;
116116
for ($i = 0; $i < 20000; $i++) {
117117
if ($lastBit === $b[$i]) {
118118
$currentRun += 1;

0 commit comments

Comments
 (0)