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


PHP PHPUnit_Framework_AssertionFailedError::toString方法代码示例

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


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

示例1: paintFail

 /**
  * Paints a failing test.
  *
  * @param PHPUnit_Framework_AssertionFailedError $message Failure object displayed in
  *   the context of the other tests.
  * @return void
  */
 public function paintFail($message)
 {
     $context = $message->getTrace();
     $realContext = $context[3];
     $context = $context[2];
     printf("FAIL on line %s\n%s in\n%s %s()\n\n", $context['line'], $message->toString(), $context['file'], $realContext['function']);
 }
开发者ID:yuuicchan0912,项目名称:sample2,代码行数:14,代码来源:CakeTextReporter.php

示例2: addFailure

 /**
  * Adds the failure detail to the current test and increases the failure
  * count for the current suite
  *
  * @param PHPUnit_Framework_Test $test current test that is being run
  * @param PHPUnit_Framework_AssertionFailedError $e PHPUnit error
  * @param int $time
  */
 public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
 {
     if ($this->currentSuite) {
         $this->currentSuite['failures']++;
     } else {
         $this->currentSession['failures']++;
     }
     $this->addStatus(TEST_FAILURE, $e->toString(), $this->getTestException($test, $e), $e->getTrace());
 }
开发者ID:biggtfish,项目名称:silverstripe-framework,代码行数:17,代码来源:SapphireTestReporter.php

示例3: addFailure

 /**
  * Adds the failure detail to the current test and increases the failure
  * count for the current suite
  * 
  * @access public
  * @param obj PHPUnit_Framework_Test, current test that is being run
  * @param obj PHPUnit_Framework_AssertationFailedError, PHPUnit error
  * @return void
  */
 public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
 {
     $this->currentSuite['failures']++;
     $this->currentTest['status'] = TEST_FAILURE;
     $this->currentTest['message'] = $e->toString();
     $this->currentTest['exception'] = $this->getTestException($test, $e);
     $this->currentTest['trace'] = $e->getTrace();
 }
开发者ID:prostart,项目名称:cobblestonepath,代码行数:17,代码来源:SapphireTestReporter.php

示例4: addFailure

 public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
 {
     $name = strpos($test->getName(), '::') ? $test->getName() : $this->current_test_suite . '::' . $test->getName();
     $this->failed_tests[$name] = $e->toString();
 }
开发者ID:humanmade,项目名称:hm-dev,代码行数:5,代码来源:hm-dev.wp-cli.test.php

示例5: addFailure

		public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) {
			$this->addTestResult($test, 'Failure [' . $e->toString() .']');
		}
开发者ID:raisanen,项目名称:sup-vt11,代码行数:3,代码来源:MinimalTestListener.php

示例6: getTraceFiles

 /**
  * Function to extract our test file information from the $e stack trace.
  * Makes the error reporting more readable, since it filters out all of the PHPUnit files.
  *
  * @param PHPUnit_Framework_AssertionFailedError $e
  * @return string with selected files based on path
  */
 public function getTraceFiles($e)
 {
     $trace = $e->getTrace();
     $path = $this->cfg->folder . $this->cfg->path;
     $path = str_replace('\\', '/', $path);
     $message = '';
     foreach ($trace as $traceLine) {
         if (isset($traceLine['file'])) {
             $file = str_replace('\\', '/', $traceLine['file']);
             if (stripos($file, $path) !== false) {
                 $message .= "\n" . $traceLine['file'] . '(' . $traceLine['line'] . '): ' . $traceLine['class'] . $traceLine['type'] . $traceLine['function'];
             }
         }
     }
     return $e->toString() . $message;
 }
开发者ID:Joomla-on-NoSQL,项目名称:LaMojo,代码行数:23,代码来源:SeleniumJoomlaTestCase.php


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