You are here

protected function TestBase::fail in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/src/TestBase.php \Drupal\simpletest\TestBase::fail()

Fire an assertion that is always negative.

Parameters

$message: (optional) A message to display with the assertion. Do not translate messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed variables in the message text, not t(). If left blank, a default message will be displayed.

$group: (optional) The group this message is in, which is displayed in a column in test output. Use 'Debug' to indicate this is debugging output. Do not translate this string. Defaults to 'Other'; most tests do not override this default.

Return value

FALSE.

169 calls to TestBase::fail()
AccountSwitcherTest::testAccountSwitching in core/modules/system/src/Tests/Session/AccountSwitcherTest.php
BlockContentCreationTest::testFailedBlockCreation in core/modules/block_content/src/Tests/BlockContentCreationTest.php
Verifies that a transaction rolls back the failed creation.
BlockContentListTest::testListing in core/modules/block_content/src/Tests/BlockContentListTest.php
Tests the custom block listing page.
BlockContentListViewsTest::testListing in core/modules/block_content/src/Tests/BlockContentListViewsTest.php
Tests the custom block listing page.
BlockContentTranslationUITest::doTestBasicTranslation in core/modules/block_content/src/Tests/BlockContentTranslationUITest.php
Tests the basic translation workflow.

... See full list

File

core/modules/simpletest/src/TestBase.php, line 907
Contains \Drupal\simpletest\TestBase.

Class

TestBase
Base class for Drupal tests.

Namespace

Drupal\simpletest

Code

protected function fail($message = NULL, $group = 'Other') {
  return $this
    ->assert(FALSE, $message, $group);
}