public function testSetAndGetPassword() { $passwordExpected = 'somePassword'; $passwordActual = $this->_adapter->setPassword($passwordExpected) ->getPassword(); $this->assertSame($passwordExpected, $passwordActual); }
public function testCanonAuth() { /* This test authenticates with each of the account name forms * (uname, uname@example.com, EXAMPLE\uname) AND it does so with * the accountCanonicalForm set to each of the account name forms * (e.g. authenticate with uname@example.com but getIdentity() returns * EXAMPLE\uname). A total of 9 authentications are performed. */ foreach ($this->_names as $form => $formName) { $options = $this->_options; $options['accountCanonicalForm'] = $form; $adapter = new Zend_Auth_Adapter_Ldap(array($options)); $adapter->setPassword(TESTS_ZEND_LDAP_ALT_PASSWORD); foreach ($this->_names as $username) { $adapter->setUsername($username); $result = $adapter->authenticate(); $this->assertTrue($result instanceof Zend_Auth_Result); $this->assertTrue($result->isValid()); $this->assertTrue($result->getCode() == Zend_Auth_Result::SUCCESS); $this->assertTrue($result->getIdentity() === $formName); } } }
/** * set password * * @param string $_credential * @return Tinebase_Auth_Ldap */ public function setCredential($_credential) { parent::setPassword($_credential); return $this; }