You are here

function DrupalTestCase::assertNotNull in SimpleTest 5

Same name and namespace in other branches
  1. 6.2 drupal_web_test_case.php \DrupalTestCase::assertNotNull()
  2. 6 drupal_test_case.php \DrupalTestCase::assertNotNull()
  3. 7.2 drupal_web_test_case.php \DrupalTestCase::assertNotNull()
  4. 7 drupal_web_test_case.php \DrupalTestCase::assertNotNull()

Will be true if the value is set.

Parameters

mixed $value Supposedly set value.: @param string $message Message to display. @return boolean True on pass. @access public

7 calls to DrupalTestCase::assertNotNull()
PageCreationTest::testPageCreation in tests/page_creation.test
PageViewTest::testPageView in tests/page_view.test
UserValidationTest::testInValidMail in tests/user_validation.test
UserValidationTest::testMaxLengthName in tests/user_validation.test
UserValidationTest::testMinLengthMail in tests/user_validation.test

... See full list

File

./drupal_test_case.php, line 450

Class

DrupalTestCase
Test case for typical Drupal tests. Extends WebTestCase for comfortable browser usage but also implements all UnitTestCase methods, I wish WebTestCase would do this.

Code

function assertNotNull($value, $message = "%s") {
  $dumper =& new SimpleDumper();
  $message = sprintf($message, "[" . $dumper
    ->describeValue($value) . "] should not be null");
  return $this
    ->assertTrue(isset($value), $message);
}