本文整理汇总了PHP中Test::setLog方法的典型用法代码示例。如果您正苦于以下问题:PHP Test::setLog方法的具体用法?PHP Test::setLog怎么用?PHP Test::setLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Test
的用法示例。
在下文中一共展示了Test::setLog方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* 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;
}
示例2: run
/**
* 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(Test $test)
{
$env = $this->getEnvironments($test->getType());
// Get the full command path to run the test.
$command = $this->getCommandPath($test->getType(), $test->getFilename(), $env);
// 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 = 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;
}