コード例 #1
0
ファイル: test-auth.php プロジェクト: barkinet/cli
 /**
  * @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();
 }
コード例 #2
0
 /**
  * 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']);
 }
コード例 #3
0
ファイル: bootstrap.php プロジェクト: barkinet/cli
/**
 * 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']);
}