public function actionRunCoverage($site)
 {
     // Call the data generation command
     $siteObj = Site::findOne(['name' => $site]);
     $command = TerminalController::getCommandPath($siteObj, '', null, true);
     TerminalController::run_terminal_command($command);
     // Return the coverage data
     Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
     return self::actionGetCoverage($site);
 }
 /**
  * Given a test, run the Codeception test.
  *
  * @param  Test $test Current test to Run.
  * @return Test $test Updated test with log and result.
  */
 public function run($site, $test)
 {
     // Get the full command path to run the test.
     $command = TerminalController::getCommandPath($site, $test->type, $test->filename);
     // Attempt to set the correct writes to Codeceptions Log path.
     //@chmod($this->getLogPath(), 0777);
     // Run the helper function (as it's not specific to Codeception)
     // which returns the result of running the terminal command into an array.
     $output = TerminalController::run_terminal_command($command);
     // Add the log to the test which also checks to see if there was a pass/fail.
     $test->setLog($output);
     return $test;
 }