diff options
Diffstat (limited to 'Core/Tests/Authentication/Provider/DaoAuthenticationProviderTest.php')
-rw-r--r-- | Core/Tests/Authentication/Provider/DaoAuthenticationProviderTest.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Core/Tests/Authentication/Provider/DaoAuthenticationProviderTest.php b/Core/Tests/Authentication/Provider/DaoAuthenticationProviderTest.php index 3e285d7..ae96f10 100644 --- a/Core/Tests/Authentication/Provider/DaoAuthenticationProviderTest.php +++ b/Core/Tests/Authentication/Provider/DaoAuthenticationProviderTest.php @@ -14,6 +14,7 @@ namespace Symfony\Component\Security\Core\Tests\Authentication\Provider; use Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder; use Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider; +use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase { @@ -37,7 +38,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase $userProvider = $this->getMock('Symfony\\Component\\Security\\Core\\User\\UserProviderInterface'); $userProvider->expects($this->once()) ->method('loadUserByUsername') - ->will($this->throwException($this->getMock('Symfony\\Component\\Security\\Core\\Exception\\UsernameNotFoundException', null, array(), '', false))) + ->will($this->throwException(new UsernameNotFoundException())) ; $provider = new DaoAuthenticationProvider($userProvider, $this->getMock('Symfony\\Component\\Security\\Core\\User\\UserCheckerInterface'), 'key', $this->getMock('Symfony\\Component\\Security\\Core\\Encoder\\EncoderFactoryInterface')); @@ -55,7 +56,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase $userProvider = $this->getMock('Symfony\\Component\\Security\\Core\\User\\UserProviderInterface'); $userProvider->expects($this->once()) ->method('loadUserByUsername') - ->will($this->throwException($this->getMock('RuntimeException', null, array(), '', false))) + ->will($this->throwException(new \RuntimeException())) ; $provider = new DaoAuthenticationProvider($userProvider, $this->getMock('Symfony\\Component\\Security\\Core\\User\\UserCheckerInterface'), 'key', $this->getMock('Symfony\\Component\\Security\\Core\\Encoder\\EncoderFactoryInterface')); |