You are here

protected function TestBase::assertNotNull in Zircon Profile 8.0

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

Check to see if a value is not NULL.

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 \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

TRUE if the assertion succeeded, FALSE otherwise.

42 calls to TestBase::assertNotNull()
BookTest::createBookNode in core/modules/book/src/Tests/BookTest.php
Creates a book node.
BulkFormAccessTest::testNodeDeleteAccess in core/modules/node/src/Tests/Views/BulkFormAccessTest.php
Tests if nodes that may not be deleted, can not be deleted in bulk.
BulkFormAccessTest::testUserDeleteAccess in core/modules/user/src/Tests/Views/BulkFormAccessTest.php
Tests if users that may not be deleted, can not be deleted in bulk.
CommentNodeChangesTest::testNodeDeletion in core/modules/comment/src/Tests/CommentNodeChangesTest.php
Tests that comments are deleted with the node.
CommentUninstallTest::testCommentUninstallWithField in core/modules/comment/src/Tests/CommentUninstallTest.php
Tests if comment module uninstallation fails if the field exists.

... See full list

File

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

Class

TestBase
Base class for Drupal tests.

Namespace

Drupal\simpletest

Code

protected function assertNotNull($value, $message = '', $group = 'Other') {
  return $this
    ->assert(isset($value), $message ? $message : SafeMarkup::format('Value @value is not NULL.', array(
    '@value' => var_export($value, TRUE),
  )), $group);
}