コード例 #1
0
ファイル: test-tokenscache.php プロジェクト: barkinet/cli
 public function testTokenExistsForEmail()
 {
     $email = '*****@*****.**';
     $file_name = getenv('HOME') . "/.terminus/tokens/{$email}";
     exec("rm {$file_name}");
     $this->assertFalse($this->tokens_cache->tokenExistsForEmail($email));
     $this->tokens_cache->add(compact('email'));
     $this->assertTrue($this->tokens_cache->tokenExistsForEmail($email));
     exec("rm {$file_name}");
 }
コード例 #2
0
ファイル: test-auth.php プロジェクト: barkinet/cli
 public function testTokenExistsForEmail()
 {
     $tokens_cache = new TokensCache();
     $tokens_dir = $tokens_cache->getCacheDir();
     $creds = getBehatCredentials();
     $file_name = $tokens_dir . '/' . $creds['username'];
     setOutputDestination($file_name);
     $this->assertTrue($this->auth->tokenExistsForEmail($creds['username']));
     resetOutputDestination($file_name);
     $this->assertFalse($this->auth->tokenExistsForEmail('invalid'));
 }
コード例 #3
0
ファイル: Auth.php プロジェクト: dalin-/cli
 /**
  * Checks to see whether the email has been set with a machine token
  *
  * @param string $email Email address to check for
  * @return bool
  */
 public function tokenExistsForEmail($email)
 {
     $file_exists = $this->tokens_cache->tokenExistsForEmail($email);
     return $file_exists;
 }