protected function TestBase::assertTrue

Check to see if a value is not false (not an empty string, 0, NULL, or FALSE).

Parameters

$value: The value on which the assertion is to be done.

$message: (optional) A message to display with the assertion. Do not translate messages: use format_string() 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

TRUE if the assertion succeeded, FALSE otherwise.

726 calls to TestBase::assertTrue()
AccessPermissionTest::testAccessPerm in drupal/core/modules/user/lib/Drupal/user/Tests/Views/AccessPermissionTest.php
Tests perm access plugin.
AccessRoleTest::testAccessRole in drupal/core/modules/user/lib/Drupal/user/Tests/Views/AccessRoleTest.php
Tests role access plugin.
AccessTest::testAccessNone in drupal/core/modules/views/lib/Drupal/views/Tests/Plugin/AccessTest.php
Tests none access plugin.
AccessTest::testStaticAccessPlugin in drupal/core/modules/views/lib/Drupal/views/Tests/Plugin/AccessTest.php
Tests static access check.
ActionUnitTest::testOperations in drupal/core/modules/system/lib/Drupal/system/Tests/Action/ActionUnitTest.php
Tests the functionality of test actions.

... See full list

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php, line 387
Definition of Drupal\simpletest\TestBase.

Class

TestBase
Base class for Drupal tests.

Namespace

Drupal\simpletest

Code

protected function assertTrue($value, $message = '', $group = 'Other') {
  return $this
    ->assert((bool) $value, $message ? $message : t('Value @value is TRUE.', array(
    '@value' => var_export($value, TRUE),
  )), $group);
}