function DrupalTestCase::assertNull

Check to see if a value is NULL.

Parameters

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

$message: The message to display along with the assertion.

$group: The type of assertion - examples are "Browser", "PHP".

Return value

TRUE if the assertion succeeded, FALSE otherwise.

17 calls to DrupalTestCase::assertNull()
BootstrapGetFilenameTestCase::testDrupalGetFilename in modules/simpletest/tests/bootstrap.test
Test that drupal_get_filename() works correctly when the file is not found in the database.
BootstrapGetFilenameWebTestCase::testDrupalGetFilename in modules/simpletest/tests/bootstrap.test
Test that drupal_get_filename() works correctly with a full Drupal site.
CronRunTestCase::testCronCacheExpiration in modules/system/system.test
Tests that hook_flush_caches() is not invoked on every single cron run.
DatabaseEmptyStatementTestCase::testEmpty in modules/simpletest/tests/database_test.test
Test that the empty result set behaves as empty.
DatabaseTaggingTestCase::testMetaData in modules/simpletest/tests/database_test.test
Test that we can attach meta data to a query object.

... See full list

File

modules/simpletest/drupal_web_test_case.php, line 354

Class

DrupalTestCase
Base class for Drupal tests.

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.