From 2c381622a5bd3ab5b22077348a088bb54ca202dc Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 31 Jan 2009 16:50:57 +0000 Subject: #88264 by Rob Loach and kscheirer: Make variable_get()'s defaultparameter default to NULL so that NULLs do not need to be specified. --- modules/simpletest/tests/bootstrap.test | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'modules/simpletest') diff --git a/modules/simpletest/tests/bootstrap.test b/modules/simpletest/tests/bootstrap.test index 149c5ef49..3cacf1175 100644 --- a/modules/simpletest/tests/bootstrap.test +++ b/modules/simpletest/tests/bootstrap.test @@ -151,7 +151,7 @@ class BootstrapVariableTestCase extends DrupalWebTestCase { // Setting and retrieving values. $variable = $this->randomName(); variable_set('simpletest_bootstrap_variable_test', $variable); - $this->assertIdentical($variable, variable_get('simpletest_bootstrap_variable_test', NULL), t('Setting and retrieving values')); + $this->assertIdentical($variable, variable_get('simpletest_bootstrap_variable_test'), t('Setting and retrieving values')); // Make sure the variable persists across multiple requests. $this->drupalGet('system-test/variable-get'); @@ -164,6 +164,17 @@ class BootstrapVariableTestCase extends DrupalWebTestCase { $this->assertIdentical($variable, $default_value, t('Deleting variables')); } + /** + * Makes sure that the default variable parameter is passed through okay. + */ + function testVariableDefaults() { + // Tests passing nothing through to the default. + $this->assertIdentical(NULL, variable_get('simpletest_bootstrap_variable_test'), t('Variables are correctly defaulting to NULL.')); + + // Tests passing 5 to the default parameter. + $this->assertIdentical(5, variable_get('simpletest_bootstrap_variable_test', 5), t('The default variable parameter is passed through correctly.')); + } + } /** -- cgit v1.2.3