Skip to content

Commit

Permalink
[Security] added a unit test for previous merge
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Aug 23, 2011
1 parent 1bb53b8 commit 277d75b
Showing 1 changed file with 20 additions and 0 deletions.
Expand Up @@ -86,6 +86,26 @@ public function testRefreshUser()
$this->assertSame($account, $provider->refreshUser($this->getAccount()));
}

public function testRefreshUserAgain()
{
$provider1 = $this->getProvider();
$provider1
->expects($this->once())
->method('refreshUser')
->will($this->throwException(new UsernameNotFoundException('not found')))
;

$provider2 = $this->getProvider();
$provider2
->expects($this->once())
->method('refreshUser')
->will($this->returnValue($account = $this->getAccount()))
;

$provider = new ChainUserProvider(array($provider1, $provider2));
$this->assertSame($account, $provider->refreshUser($this->getAccount()));
}

/**
* @expectedException Symfony\Component\Security\Core\Exception\UnsupportedUserException
*/
Expand Down

0 comments on commit 277d75b

Please sign in to comment.