當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。