public function test_with_working_credentials() { $_POST['username'] = $this->username; $_POST['password'] = $this->password; $authN = new LDAPAuthentication(); $this->assertTrue($authN->authenticate() instanceof User); }
/** * Verify that bad credentials cause failure. * * @return void * @access public */ public function testWithWrongCredentials() { try { $_POST['username'] = $this->_username; $_POST['password'] = $this->_password . 'badpass'; $authN = new LDAPAuthentication(); $this->assertTrue(PEAR::isError($authN->authenticate())); } catch (IOException $unexpected) { $this->fail('Unexpected Exception with: ' . $unexpected->getMessage()); } }