public function test_with_working_credentials() { $_POST['username'] = $this->username; $_POST['password'] = $this->password; $authN = new ILSAuthentication(); $this->assertTrue($authN->authenticate() instanceof User); }
/** * Make sure authentication fails with wrong password. * * @return void * @access public */ public function testWithWrongCredentials() { try { $_POST['username'] = $this->_username; $_POST['password'] = $this->_password . 'test'; $authN = new ILSAuthentication(); $this->assertTrue(PEAR::isError($authN->authenticate())); } catch (IOException $unexpected) { $this->fail('Unexpected Exception with: ' . $unexpected->getMessage()); } }