[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/test/tests/config/ -> configdbstorage_test.class.php (source)

   1  <?php
   2  
   3      lt_include( PLOG_CLASS_PATH."class/test/helpers/lifetypetestcase.class.php" );
   4      lt_include( PLOG_CLASS_PATH."class/config/configdbstorage.class.php" );        
   5  
   6      /**
   7       * \ingroup Test
   8       *
   9       * Test cases for the Config class, but only the database-based backend, not the file backend
  10       */
  11      class ConfigDbStorage_Test extends LifeTypeTestCase
  12      {
  13          /** 
  14           * regression test for svn revision 3726. It basically tests whether the ConfigDbStorage::getValue()
  15           * method will return the default value specified as the second parameter when the provided
  16           * key doesn't exist.
  17           */
  18  		function testGetValueWithDefaultValue()
  19          {
  20              $config = new ConfigDbStorage();
  21              
  22              // request a bogus key and see if we get the default value
  23              $defaultValue = "333";
  24              $value = $config->getValue( "this_key_should_really_really_not_exist", $defaultValue );
  25              
  26              // check if they're equal (they should!)
  27              $this->assertEquals( $defaultValue, $value, "getValue() did not return the default value when a non-existant key was requested, please see svn revision 3726" );
  28          }
  29      }
  30  ?>


Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics