Exemplo n.º 1
0
 public function testVerifyIdentityNoAssignedRoles()
 {
     $password = '******';
     $this->_encryptorMock->expects($this->once())->method('validateHash')->with($password, $this->_model->getPassword())->will($this->returnValue(true));
     $this->_model->setIsActive(true);
     $this->_resourceMock->expects($this->once())->method('hasAssigned2Role')->will($this->returnValue(false));
     $this->setExpectedException('Magento\\Framework\\Exception\\AuthenticationException', 'Access denied.');
     $this->_model->verifyIdentity($password);
 }
 /**
  * @return void
  */
 public function testVerifyIdentityNoAssignedRoles()
 {
     $password = '******';
     $this->encryptorMock->expects($this->once())->method('validateHash')->with($password, $this->model->getPassword())->willReturn(true);
     $this->model->setIsActive(true);
     $this->resourceMock->expects($this->once())->method('hasAssigned2Role')->willReturn(false);
     $this->setExpectedException('Magento\\Framework\\Exception\\AuthenticationException', 'You need more permissions to access this.');
     $this->model->verifyIdentity($password);
 }