当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPUnit_Framework_AssertionFailedError::getTraceAsString方法代码示例

本文整理汇总了PHP中PHPUnit_Framework_AssertionFailedError::getTraceAsString方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_AssertionFailedError::getTraceAsString方法的具体用法?PHP PHPUnit_Framework_AssertionFailedError::getTraceAsString怎么用?PHP PHPUnit_Framework_AssertionFailedError::getTraceAsString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPUnit_Framework_AssertionFailedError的用法示例。


在下文中一共展示了PHPUnit_Framework_AssertionFailedError::getTraceAsString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addFailure

 public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
 {
     $class = get_class($test);
     $message = $this->escape($e->getMessage());
     $trace = $this->escape($e->getTraceAsString());
     echo "##teamcity[testFailed type='failure' name='{$class}.{$test->getName()}' message='{$message}'" . " details='{$trace}']\n";
 }
开发者ID:jareddreyer,项目名称:catalogue,代码行数:7,代码来源:TeamCityListener.php

示例2: addFailure

 public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
 {
     $this->_fails += 1;
     if ($this->_fails == 1) {
         echo "\n<div class=\"failure\">";
     }
     printf("Test '%s' failed : %s.<br />\n<pre>%s</pre>\n", $test->getName(), htmlentities($e->getMessage()), (string) $e->getTraceAsString());
     //echo("Failure $this->_fails : $t<br>\n");
 }
开发者ID:Alphenus,项目名称:ilmomasiina-php,代码行数:9,代码来源:HTML_TestListener.php

示例3: addFailure

 public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
 {
     if ($this->verbose) {
         echo "        FAIL: '" . $e->getMessage() . "'\n" . $e->getTraceAsString();
     }
     parent::addFailure($test, $e, $time);
     if ($this->_blDBResetPerTest && !isset($test->blNoDbResetAfterTest)) {
         $this->_oDBMaintenance->restoreDB($this->_iDBChangeMode, $this->_iDBChangeOutput);
         echo "|";
     }
 }
开发者ID:OXIDprojects,项目名称:debugax,代码行数:11,代码来源:oxPrinter.php

示例4: addFailure

 /**
  * A failure occurred.
  *
  * @todo Add check that $test is instance of PHPUnit_Framework_TestCase
  *
  * @param  PHPUnit_Framework_Test                 $test
  * @param  PHPUnit_Framework_AssertionFailedError $e
  * @param  float                                  $time
  */
 public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
 {
     $failures = array();
     $testResult = $test->getTestResultObject();
     /** @var $failure PHPUnit_Framework_TestFailure */
     foreach ($testResult->failures() as $failure) {
         $hash = "{$e->getMessage()} {$e->getTraceAsString()}";
         if (isset($failures[$hash])) {
             continue;
         }
         $array = array('type' => self::MESSAGE_COMPARISON_FAILURE, 'name' => $test->getName(), 'message' => $e->getMessage(), 'details' => $e->getTraceAsString());
         /** @var $exception PHPUnit_Framework_ExpectationFailedException */
         $exception = $failure->thrownException();
         $comparisonFailure = $exception->getComparisonFailure();
         if ($comparisonFailure instanceof PHPUnit_Framework_ComparisonFailure) {
             $array += array('expected' => $comparisonFailure->getExpectedAsString(), 'actual' => $comparisonFailure->getActualAsString());
         }
         $message = $this->getServiceMessage(self::MESSAGE_TEST_FAILED, $array);
         $this->write($message);
         $failures[$hash] = true;
     }
 }
开发者ID:uyga,项目名称:phpunit-testlistener-teamcity,代码行数:31,代码来源:TestListener.php


注:本文中的PHPUnit_Framework_AssertionFailedError::getTraceAsString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。