[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/config/tests/cases/ -> lmbConfTest.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
   8   */
   9  lmb_require('limb/config/src/lmbConf.class.php');
  10  
  11  class lmbConfTest extends UnitTestCase
  12  {
  13    function testGet()
  14    {
  15      $conf = new lmbConf(dirname(__FILE__) . '/conf.php');
  16      $this->assertEqual($conf->get('foo'), 1);
  17      $this->assertEqual($conf->get('bar'), 2);
  18    }
  19  
  20    function testOverride()
  21    {
  22      $conf = new lmbConf(dirname(__FILE__) . '/other.conf.php');
  23      $this->assertEqual($conf->get('foo'), 3);
  24      $this->assertEqual($conf->get('bar'), 2);
  25    }
  26  
  27    function testImplementsIterator()
  28    {
  29      $conf = new lmbConf(dirname(__FILE__) . '/conf.php');
  30  
  31      $result = array();
  32      foreach($conf as $key => $value)
  33        $result[$key] = $value;
  34  
  35      $this->assertEqual($result, array('foo' => 1, 'bar' => 2));
  36    }
  37  }
  38  
  39  ?>


Generated: Fri Dec 5 04:05:07 2008 Cross-referenced by PHPXref 0.7