Пример #1
0
 public function testLoadUserByUsernameNotFound()
 {
     $username = '******';
     $this->ldapManager->expects($this->once())->method('findUserByUsername')->will($this->returnValue(null));
     try {
         $this->userProvider->loadUserByUsername($username);
         $this->fail('Expected Symfony\\Component\\Security\\Core\\Exception\\UsernameNotFoundException to be thrown');
     } catch (UsernameNotFoundException $notFoundException) {
         $this->assertEquals($username, $notFoundException->getUsername());
     }
 }
Пример #2
0
 /**
  * @expectedException Symfony\Component\Security\Core\Exception\UsernameNotFoundException
  */
 public function testLoadUserByUsernameNotFound()
 {
     $username = '******';
     $this->ldapManager->expects($this->once())->method('findUserByUsername')->will($this->returnValue(null));
     $this->userProvider->loadUserByUsername($username);
 }