/** * @expectedException \Terminus\Exceptions\TerminusException * @expectedExceptionMessage Authorization failed */ public function testLogInViaUsernameAndPassword() { $creds = getBehatCredentials(); $this->assertTrue($this->auth->logInViaUsernameAndPassword($creds['username'], $creds['password'])); $this->auth->logInViaUsernameAndPassword('invalid', 'password'); setDummyCredentials(); }
/** * Logs you in to Pantheon * * @param string[] $options Elements as follow: * string username Your Pantheon username * string password Your Pantheon password * @return void * @throws TerminusException */ private function logIn(array $options) { if (is_null($options['username']) || is_null($options['password'])) { throw new TerminusException('You need to supply both a username and a password to the constructor.'); } $auth = new Auth(); $auth->logInViaUsernameAndPassword($options['username'], $options['password']); }
/** * Logs in with Behad credentials to enable Behat fixture use * * @return void */ function logInWithBehatCredentials() { $creds = getBehatCredentials(); $auth = new Auth(); $auth->logInViaUsernameAndPassword($creds['username'], $creds['password']); }