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


PHP PHPUnit_Framework_TestCase::toString方法代码示例

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


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

示例1: endTest

 /**
  * Checks if deployment configuration has been changed by a test
  *
  * Changing deployment configuration violates isolation between tests, so further tests may become broken.
  * To fix this issue, find out why this test changes deployment configuration.
  * If this is intentional, then it must be reverted to the previous state within the test.
  * After that, the application needs to be wiped out and reinstalled.
  *
  * @param \PHPUnit_Framework_TestCase $test
  * @return void
  */
 public function endTest(\PHPUnit_Framework_TestCase $test)
 {
     $config = $this->reader->load();
     if ($this->config != $config) {
         $error = "\n\nERROR: deployment configuration is corrupted. The application state is no longer valid.\n" . 'Further tests may fail.' . " This test failure may be misleading, if you are re-running it on a corrupted application.\n" . $test->toString() . "\n";
         $test->fail($error);
     }
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:19,代码来源:DeploymentConfig.php

示例2: toString

 /**
  * Returns a string representation of the test case.
  *
  * @return string
  */
 public function toString()
 {
     $buffer = parent::toString();
     if (!empty($this->browserName)) {
         $buffer .= ' with browser ' . $this->browserName;
     }
     return $buffer;
 }
开发者ID:ninodafonte,项目名称:SIFO,代码行数:13,代码来源:SeleniumTestCase.php

示例3: fail

 /**
  * Fails the test with specified error message
  *
  * @param string $message
  * @param \PHPUnit_Framework_TestCase $test
  * @throws \Exception
  */
 private static function fail($message, \PHPUnit_Framework_TestCase $test)
 {
     $test->fail("{$message} in the test '{$test->toString()}'");
     throw new \Exception('The above line was supposed to throw an exception.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:12,代码来源:Cache.php

示例4: getTestMessage

 /**
  * @param \PHPUnit_Framework_TestCase $test
  * @param bool $inProgress
  * @return Message
  */
 protected function getTestMessage(\PHPUnit_Framework_TestCase $test, $inProgress = false)
 {
     if (!$test instanceof TestCase) {
         return $this->message = $this->message($test->toString())->style('focus')->prepend($inProgress ? 'Running ' : '');
     }
     $filename = $test->getSignature();
     if ($test->getFeature()) {
         return $this->message = $this->message("<focus>%s</focus> (%s) ")->prepend($inProgress ? 'Trying to ' : '')->with($inProgress ? $test->getFeature() : ucfirst($test->getFeature()), $filename);
     }
     return $this->message = $this->message("<focus>%s</focus> ")->prepend($inProgress ? 'Running ' : '')->with($filename);
 }
开发者ID:alexanderkuz,项目名称:test-yii2,代码行数:16,代码来源:Console.php


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