[pLog-svn] r3812 - plog/trunk/class/test/tests/config
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Wed Jul 26 12:19:27 GMT 2006
Author: oscar
Date: 2006-07-26 12:19:26 +0000 (Wed, 26 Jul 2006)
New Revision: 3812
Modified:
plog/trunk/class/test/tests/config/configfilestorage_test.class.php
Log:
another test case, used also for ConfigDbStorage
Modified: plog/trunk/class/test/tests/config/configfilestorage_test.class.php
===================================================================
--- plog/trunk/class/test/tests/config/configfilestorage_test.class.php 2006-07-26 12:14:16 UTC (rev 3811)
+++ plog/trunk/class/test/tests/config/configfilestorage_test.class.php 2006-07-26 12:19:26 UTC (rev 3812)
@@ -218,5 +218,22 @@
$this->assertEquals( $newValue, $cf2->getValue( $newKey ),
"$newKey was not saved properly to file ".$this->file1 );
}
+
+ /**
+ * regression test for svn revision 3726. It basically tests whether the ConfigFileStorage::getValue()
+ * method will return the default value specified as the second parameter when the provided
+ * key doesn't exist.
+ */
+ function testGetValueWithDefaultValue()
+ {
+ $cf = new ConfigFileStorage( Array( "file" => $this->file1 ));
+
+ // request a bogus key and see if we get the default value
+ $defaultValue = "333";
+ $value = $cf->getValue( "this_key_should_really_really_not_exist", $defaultValue );
+
+ // check if they're equal (they should!)
+ $this->assertEquals( $defaultValue, $value, "getValue() did not return the default value when a non-existant key was requested, please see svn revision 3726" );
+ }
}
?>
\ No newline at end of file
More information about the pLog-svn
mailing list