summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Core/Tests/Authentication/Provider/DaoAuthenticationProviderTest.php18
-rw-r--r--Core/Tests/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php6
-rw-r--r--Core/Tests/Util/SecureRandomTest.php4
-rw-r--r--Http/Tests/RememberMe/ResponseListenerTest.php2
-rw-r--r--Http/Tests/RememberMe/TokenBasedRememberMeServicesTest.php2
5 files changed, 16 insertions, 16 deletions
diff --git a/Core/Tests/Authentication/Provider/DaoAuthenticationProviderTest.php b/Core/Tests/Authentication/Provider/DaoAuthenticationProviderTest.php
index ed4fe10..3e285d7 100644
--- a/Core/Tests/Authentication/Provider/DaoAuthenticationProviderTest.php
+++ b/Core/Tests/Authentication/Provider/DaoAuthenticationProviderTest.php
@@ -115,7 +115,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
->method('isPasswordValid')
;
- $provider = $this->getProvider(false, false, $encoder);
+ $provider = $this->getProvider(null, null, $encoder);
$method = new \ReflectionMethod($provider, 'checkAuthentication');
$method->setAccessible(true);
@@ -142,7 +142,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue(true))
;
- $provider = $this->getProvider(false, false, $encoder);
+ $provider = $this->getProvider(null, null, $encoder);
$method = new \ReflectionMethod($provider, 'checkAuthentication');
$method->setAccessible(true);
@@ -171,7 +171,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue(false))
;
- $provider = $this->getProvider(false, false, $encoder);
+ $provider = $this->getProvider(null, null, $encoder);
$method = new \ReflectionMethod($provider, 'checkAuthentication');
$method->setAccessible(true);
@@ -206,7 +206,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue('newFoo'))
;
- $provider = $this->getProvider(false, false, null);
+ $provider = $this->getProvider();
$reflection = new \ReflectionMethod($provider, 'checkAuthentication');
$reflection->setAccessible(true);
$reflection->invoke($provider, $dbUser, $token);
@@ -231,7 +231,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue('foo'))
;
- $provider = $this->getProvider(false, false, null);
+ $provider = $this->getProvider();
$reflection = new \ReflectionMethod($provider, 'checkAuthentication');
$reflection->setAccessible(true);
$reflection->invoke($provider, $dbUser, $token);
@@ -245,7 +245,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue(true))
;
- $provider = $this->getProvider(false, false, $encoder);
+ $provider = $this->getProvider(null, null, $encoder);
$method = new \ReflectionMethod($provider, 'checkAuthentication');
$method->setAccessible(true);
@@ -270,17 +270,17 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
return $mock;
}
- protected function getProvider($user = false, $userChecker = false, $passwordEncoder = null)
+ protected function getProvider($user = null, $userChecker = null, $passwordEncoder = null)
{
$userProvider = $this->getMock('Symfony\\Component\\Security\\Core\\User\\UserProviderInterface');
- if (false !== $user) {
+ if (null !== $user) {
$userProvider->expects($this->once())
->method('loadUserByUsername')
->will($this->returnValue($user))
;
}
- if (false === $userChecker) {
+ if (null === $userChecker) {
$userChecker = $this->getMock('Symfony\\Component\\Security\\Core\\User\\UserCheckerInterface');
}
diff --git a/Core/Tests/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php b/Core/Tests/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php
index 522edb4..4a8bf6c 100644
--- a/Core/Tests/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php
+++ b/Core/Tests/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php
@@ -114,17 +114,17 @@ class PreAuthenticatedAuthenticationProviderTest extends \PHPUnit_Framework_Test
return $token;
}
- protected function getProvider($user = false, $userChecker = false)
+ protected function getProvider($user = null, $userChecker = null)
{
$userProvider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface');
- if (false !== $user) {
+ if (null !== $user) {
$userProvider->expects($this->once())
->method('loadUserByUsername')
->will($this->returnValue($user))
;
}
- if (false === $userChecker) {
+ if (null === $userChecker) {
$userChecker = $this->getMock('Symfony\Component\Security\Core\User\UserCheckerInterface');
}
diff --git a/Core/Tests/Util/SecureRandomTest.php b/Core/Tests/Util/SecureRandomTest.php
index 4cfdb2c..e3fde69 100644
--- a/Core/Tests/Util/SecureRandomTest.php
+++ b/Core/Tests/Util/SecureRandomTest.php
@@ -111,8 +111,8 @@ class SecureRandomTest extends \PHPUnit_Framework_TestCase
{
$b = $this->getBitSequence($secureRandom, 20000);
- $longestRun = 0;
- $currentRun = $lastBit = null;
+ $longestRun = $currentRun = 0;
+ $lastBit = null;
for ($i = 0; $i < 20000; $i++) {
if ($lastBit === $b[$i]) {
$currentRun += 1;
diff --git a/Http/Tests/RememberMe/ResponseListenerTest.php b/Http/Tests/RememberMe/ResponseListenerTest.php
index 5d69a65..3c228b4 100644
--- a/Http/Tests/RememberMe/ResponseListenerTest.php
+++ b/Http/Tests/RememberMe/ResponseListenerTest.php
@@ -49,7 +49,7 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase
{
$listener = new ResponseListener();
- $this->assertSame(array(KernelEvents::RESPONSE => 'onKernelResponse'), $listener->getSubscribedEvents());
+ $this->assertSame(array(KernelEvents::RESPONSE => 'onKernelResponse'), ResponseListener::getSubscribedEvents());
}
private function getRequest(array $attributes = array())
diff --git a/Http/Tests/RememberMe/TokenBasedRememberMeServicesTest.php b/Http/Tests/RememberMe/TokenBasedRememberMeServicesTest.php
index 95c942e..8d81d8a 100644
--- a/Http/Tests/RememberMe/TokenBasedRememberMeServicesTest.php
+++ b/Http/Tests/RememberMe/TokenBasedRememberMeServicesTest.php
@@ -32,7 +32,7 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase
public function testAutoLoginThrowsExceptionOnInvalidCookie()
{
$service = $this->getService(null, array('name' => 'foo', 'path' => null, 'domain' => null, 'always_remember_me' => false, 'remember_me_parameter' => 'foo'));
- $request = new Request;
+ $request = new Request();
$request->request->set('foo', 'true');
$request->cookies->set('foo', 'foo');