コード例 #1
0
 /**
  * Login LDAP user to Bitrix. If user exists in Bitrix, simple login. If
  * not, create before.
  *
  * @internal
  *
  * @param Capall_Ldaper_LdapUser $ldapUser
  *
  * @return int Bitrix's user identifier.
  */
 public function getBitrixUser($ldapUser)
 {
     if (!($bitrixUserIdentifier = $this->bitrixUserManager->getByLogin($ldapUser->getLogin()))) {
         $bitrixUserIdentifier = $this->bitrixUserManager->create($ldapUser->getLogin(), $ldapUser->getMail());
     }
     return $bitrixUserIdentifier;
 }
コード例 #2
0
 /**
  * Expects exception...
  */
 public function testFailureCreation()
 {
     $this->markTestIncomplete('LAST_ERROR :(');
     $this->setExpectedException('Capall_Ldaper_BitrixUserCreationException');
     $this->_bitrixUser->expects($this->once())->method('Add')->with($this->isType('array'))->will($this->returnValue(false));
     $manager = new Capall_Ldaper_BitrixUserManager($this->_bitrixUser);
     $manager->create('test', '*****@*****.**');
 }