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


PHP WebTestBase::error方法代码示例

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


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

示例1: error

 /**
  * Stores errors into an array.
  *
  * This test class is trying to verify that simpletest correctly sees errors
  * and warnings. However, it can't generate errors and warnings that
  * propagate up to the testing framework itself, or these tests would always
  * fail. So, this special copy of error() doesn't propagate the errors up
  * the class hierarchy. It just stuffs them into a protected collectedErrors
  * array for various assertions to inspect.
  */
 protected function error($message = '', $group = 'Other', array $caller = NULL)
 {
     // Due to a WTF elsewhere, simpletest treats debug() and verbose()
     // messages as if they were an 'error'. But, we don't want to collect
     // those here. This function just wants to collect the real errors (PHP
     // notices, PHP fatal errors, etc.), and let all the 'errors' from the
     // 'User notice' group bubble up to the parent classes to be handled (and
     // eventually displayed) as normal.
     if ($group == 'User notice') {
         parent::error($message, $group, $caller);
     } else {
         $this->collectedErrors[] = array('message' => $message, 'group' => $group, 'caller' => $caller);
     }
 }
开发者ID:sarahwillem,项目名称:OD8,代码行数:24,代码来源:SimpleTestErrorCollectorTest.php

示例2: error

 /**
  * {@inheritdoc}
  */
 protected function error($message = '', $group = 'Other', array $caller = NULL)
 {
     if (!empty($this->expectedExceptionMessage) && strpos($message, $this->expectedExceptionMessage) !== FALSE) {
         // We're expecting this error.
         return FALSE;
     }
     return parent::error($message, $group, $caller);
 }
开发者ID:318io,项目名称:318-io,代码行数:11,代码来源:UncaughtExceptionTest.php

示例3: error

 /**
  * {@inheritdoc}
  */
 protected function error($message = '', $group = 'Other', array $caller = NULL)
 {
     if ($message === 'Oh oh, bananas in the instruments.') {
         // We're expecting this error.
         return;
     }
     return parent::error($message, $group, $caller);
 }
开发者ID:RealLukeMartin,项目名称:drupal8tester,代码行数:11,代码来源:UncaughtExceptionTest.php


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