You are here

function DrupalTestCase::assertNull in SimpleTest 6

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

Will be true if the value is null.

Parameters

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

2 calls to DrupalTestCase::assertNull()
UserValidationTest::testValidMail in tests/user_module.test
UserValidationTest::testValidName in tests/user_module.test

File

./drupal_test_case.php, line 559

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 assertNull($value, $message = "%s") {
  $dumper =& new SimpleDumper();
  $message = sprintf($message, "[" . $dumper
    ->describeValue($value) . "] should be null");
  return $this
    ->assertTrue(!isset($value), $message);
}