コード例 #1
0
ファイル: test-utils.php プロジェクト: karudonaldson/terminus
 /**
  * @vcr utils#checkCurrentVersion
  */
 public function testCheckForUpdate()
 {
     $log_file = getLogFileName();
     setOutputDestination($log_file);
     Terminus::getCache()->putData('latest_release', ['check_date' => strtotime('8 days ago')]);
     Utils\checkForUpdate();
     $file_contents = explode("\n", file_get_contents($log_file));
     $this->assertFalse(strpos(array_pop($file_contents), 'An update to Terminus is available.'));
     resetOutputDestination($log_file);
 }
コード例 #2
0
ファイル: test-runner.php プロジェクト: sammys/terminus
 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);
 }