Ejemplo n.º 1
0
 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}");
 }
Ejemplo n.º 2
0
 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'));
 }
Ejemplo n.º 3
0
 /**
  * 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;
 }