本文整理汇总了PHP中PHPUnit_TextUI_ResultPrinter::endTest方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_TextUI_ResultPrinter::endTest方法的具体用法?PHP PHPUnit_TextUI_ResultPrinter::endTest怎么用?PHP PHPUnit_TextUI_ResultPrinter::endTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_TextUI_ResultPrinter
的用法示例。
在下文中一共展示了PHPUnit_TextUI_ResultPrinter::endTest方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: endTest
/**
* A test ended.
*
* @param PHPUnit_Framework_Test $test
* @param float $time
*/
public function endTest(\PHPUnit_Framework_Test $test, $time)
{
parent::endTest($test, $time);
if ($test instanceof \Pagosoft\PSpec\Test) {
$this->numAssertions += $test->getNumAssertions();
}
}
示例2: endTest
public function endTest(\PHPUnit_Framework_Test $test, $time)
{
parent::endTest($test, $time);
if ($this->debug) {
foreach ($this->timeColors as $threshold => $color) {
if ($time >= $threshold) {
$timeColor = $color;
break;
}
}
$this->write(' ');
$this->writeWithColor($timeColor, '[' . number_format($time, 3) . 's]', false);
$this->write(' ');
$this->writeWithColor('fg-cyan', \PHPUnit_Util_Test::describe($test), true);
}
}
示例3: endTest
public function endTest(PHPUnit_Framework_Test $test, $time)
{
if ($this->_verbose) {
echo date('Y-m-d H:i:s') . ': finished ' . $test->toString() . " in {$time}\n\n";
}
$app = Kwf_Registry::get('config')->application->id;
if (!file_exists("/www/testtimes/{$app}")) {
mkdir("/www/testtimes/{$app}");
}
file_put_contents("/www/testtimes/{$app}/{$test->toString()}", $time);
if ($this->_expectedTimes) {
$this->_currentProgress += $this->_expectedTimes[$test->toString()];
$this->_currentTest++;
}
return parent::endTest($test, $time);
}
示例4: endTest
public function endTest(PHPUnit_Framework_Test $test, $time)
{
$t = microtime(true) - $this->_timeStats['startTime'];
if ($this->_timeStats['min'] > $t) {
$this->_timeStats['min'] = $t;
}
if ($this->_timeStats['max'] < $t) {
$this->_timeStats['max'] = $t;
$this->_timeStats['slowest'] = $test->getName();
}
$this->_timeStats['avg'] = ($t + $this->_timeStats['avg'] * $this->_timeStats['cnt']) / ++$this->_timeStats['cnt'];
parent::endTest($test, $time);
if ($this->_blDBResetPerTest && !isset($test->blNoDbResetAfterTest)) {
$this->_oDBMaintenance->restoreDB($this->_iDBChangeMode, $this->_iDBChangeOutput);
echo "|";
}
}
示例5: endTest
/**
* A test ended.
*
* @param PHPUnit_Framework_Test $test
* @param float $time
*/
public function endTest(PHPUnit_Framework_Test $test, $time)
{
parent::endTest($test, $time);
$this->printEvent('testFinished', ['name' => $test->getName(), 'duration' => (int) (round($time, 2) * 1000)]);
}
示例6: endTest
/**
* A test ended.
*
* @param PHPUnit_Framework_Test $test
* @param float $time
*/
public function endTest(PHPUnit_Framework_Test $test, $time)
{
if (!$this->lastTestFailed) {
$message = 'passed';
$this->write($this->colors ? Stagehand_TestRunner_Coloring::green($message) : $message);
}
parent::endTest($test, $time);
$this->lastEvent = PHPUnit_TextUI_ResultPrinter::EVENT_TEST_END;
}
示例7: endTest
/**
* A test ended.
*
* @param PHPUnit_Framework_Test $test
* @param float $time
*/
public function endTest(PHPUnit_Framework_Test $test, $time)
{
//echo __METHOD__.chr(10);
if (!$this->lastTestFailed) {
$this->printTestdox($test, 'X');
$this->lastTestFailed = true;
// Make parent::endTest() shut up
}
parent::endTest($test, $time);
}
示例8: endTest
/**
* A test ended.
*
* @param PHPUnit_Framework_Test $test
* @param float $time
* @return void
*/
public function endTest(PHPUnit_Framework_Test $test, $time)
{
if (method_exists($test, 'getMessages')) {
foreach ($test->getMessages() as $testMessage) {
$testMessage = sprintf("%s [%s]", str_repeat(' ', $this->level), $testMessage);
$this->write($testMessage . "\n");
}
}
if (!$this->lastTestFailed) {
$message = sprintf("%s SUCCESS. (Duration: %s sec)", str_repeat(' ', $this->level), $this->getDuration());
if ($this->colors) {
$this->write("[32;1m{$message}[0m" . "\n");
} else {
$this->write($message . "\n");
}
}
$this->level--;
return parent::endTest($test, $time);
}
示例9: endTest
/**
* A test ended.
*
* @param PHPUnit_Framework_Test $test
* @param float $time
*/
public function endTest(PHPUnit_Framework_Test $test, $time)
{
parent::endTest($test, $time);
wfDebugLog($this->logChannel, 'End test ' . $this->getTestName($test));
}
示例10: endTest
/**
* A test ended.
*
* @param PHPUnit_Framework_Test $test
* @param float $time
*/
public function endTest(PHPUnit_Framework_Test $test, $time)
{
if (!$this->lastTestFailed) {
$message = 'passed';
$this->write($this->colors ? Stagehand_TestRunner_Coloring::green($message) : $message);
}
parent::endTest($test, $time);
}
示例11: endTest
/**
* A test ended.
*
* @param PHPUnit_Framework_Test $test
* @param float $time
*/
public function endTest(PHPUnit_Framework_Test $test, $time)
{
if (!$this->colors) {
parent::endTest($test, $time);
return;
}
if (!$this->lastTestFailed) {
$this->writeProgress(Stagehand_TestRunner_Coloring::green('.'));
}
if ($test instanceof PHPUnit_Framework_TestCase) {
$this->numAssertions += $test->getNumAssertions();
}
$this->lastEvent = self::EVENT_TEST_END;
$this->lastTestFailed = false;
}
示例12: endTest
/**
* {@inheritdoc}
*/
public function endTest(\PHPUnit_Framework_Test $test, $time)
{
if ($this->debug) {
return parent::endTest($test, $time);
}
if (!$this->lastTestFailed) {
$this->writeProgress('pass');
}
if ($test instanceof \PHPUnit_Framework_TestCase) {
$this->numAssertions += $test->getNumAssertions();
} else {
if ($test instanceof \PHPUnit_Extensions_PhptTestCase) {
$this->numAssertions++;
}
}
$this->lastTestFailed = FALSE;
}
示例13: endTest
public function endTest(PHPUnit_Framework_Test $test, $time)
{
echo "\n" . date('Y-m-d H:i:s') . ': finished ' . $test->toString() . " in {$time}\n";
return parent::endTest($test, $time);
}