public function getBin($execName) { $vendorDir = $this->_runner->getConfig('vendorDir', ''); if (!empty($vendorDir) && file_exists($vendorDir . '/bin/' . $execName)) { return $vendorDir . '/bin/' . $execName; } else { $toolsDir = $this->_runner->getConfig('toolsDir', ''); if (!empty($toolsDir) && file_exists($toolsDir . '/' . $execName)) { return $toolsDir . '/' . $execName; } else { return $execName; } } }
public function log($str) { // hide sensitive values $hideKeys = array('password', 'secret', 'login'); $hideKeys = array_merge($hideKeys, $this->_runner->getConfig('hideConfigKeys', array())); foreach ($hideKeys as $k) { foreach ($this->_runner->getConfig() as $ck => $cv) { if (strpos(strtolower($ck), strtolower($k)) !== false) { if (!empty($cv)) { $str = str_replace($cv, '*****', $str); } } } } echo $str . "\n"; return true; }
protected function _exec() { $cmd = $this->_getCmd(); $utilHelper = $this->_runner->getUtilHelper(); $utilHelper->exec($cmd); $out = $utilHelper->getExecOutput(); $returnvar = $utilHelper->getExecReturnvar(); if ($returnvar !== 0 && $returnvar !== 1 && $returnvar !== 2) { return array(false, $returnvar, $cmd, $out); } else { return $this->_verifySuccessfulRun($cmd, $out, $returnvar); } }
public function setup() { $ret = $this->_runner->getEnvironment()->invoke('IntegrationTest::setup', array($this->_integid, $this)); if (!$ret) { return $this->_runner->error('failed to do initial setting up of environment for integration'); } elseif (!$this->_initDirectories()) { return $this->_runner->error('failed to initialize integration directories'); } elseif (!$this->_clearDirectoriesContent()) { return $this->_runner->error('failed to clear integration directories content'); } else { return true; } }
protected function _run() { $ret = parent::_run(); // make sure the relevant testproj helpers ran if (isset($GLOBALS['RAN_test']) && $GLOBALS['RAN_test']) { $logfile = $this->getConfig('buildPath') . '/output/testproj/logs/testUnitTestsBootstrap.log'; if (!file_exists($logfile)) { $ret = $this->error('did not find ' . $logfile); } else { $tmp = explode("\n", file_get_contents($logfile)); $ret = $tmp[count($tmp) - 2] == 'OK' ? $ret : false; } } return $ret; }