示例#1
0
 public function testAdd()
 {
     $email = '*****@*****.**';
     $file_name = getenv('HOME') . "/.terminus/tokens/{$email}";
     exec("rm {$file_name}");
     $this->tokens_cache->add(compact('email'));
     $contents = retrieveOutput($file_name);
     exec("rm {$file_name}");
     $this->assertTrue(strpos($contents, $email) !== false);
 }
示例#2
0
 public function testSetLogger()
 {
     // This test assumes that the debug output defaults to off.
     $file_name = getLogFileName();
     $message = 'The sky is the daily bread of the eyes.';
     setOutputDestination($file_name);
     $this->runner->getLogger()->debug($message);
     $output = retrieveOutput($file_name);
     $this->assertFalse(strpos($output, $message) !== false);
     $this->runner->setLogger(['debug' => true, 'format' => 'json']);
     $this->runner->getLogger()->debug($message);
     $output = retrieveOutput($file_name);
     $this->assertTrue(strpos($output, $message) !== false);
     resetOutputDestination($file_name);
 }
示例#3
0
 public function testLaunchSelf()
 {
     $file_name = '/tmp/output';
     //Testing the library route
     setOutputDestination($file_name);
     $return = $this->launch_helper->launchSelf(['command' => "art unicorn > {$file_name}"]);
     $output = retrieveOutput($file_name);
     $this->assertTrue(strpos($output, "<.'_.''") !== false);
     $this->assertEquals($return, 0);
     resetOutputDestination($file_name);
     //Testing the command-line route
     setOutputDestination($file_name);
     $GLOBALS['argv'] = [__DIR__ . '/../../../php/boot-fs.php'];
     $return = $this->launch_helper->launchSelf(['command' => "art unicorn > {$file_name}"]);
     $output = retrieveOutput($file_name);
     $this->assertTrue(strpos($output, "<.'_.''") !== false);
     $this->assertEquals($return, 0);
     resetOutputDestination($file_name);
 }
示例#4
0
 public function testRender()
 {
     $this->completions->render();
     $output = retrieveOutput();
     $this->assertTrue(strpos($output, '--format=') !== false);
 }