[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/validation/tests/cases/ -> lmbErrorListTest.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/validation/src/lmbErrorList.class.php');
  10  
  11  class lmbErrorListTest extends UnitTestCase
  12  {
  13    function testAddFieldError()
  14    {
  15      $list = new lmbErrorList();
  16  
  17      $this->assertTrue($list->isValid());
  18  
  19      $list->addError($message = 'error_group', array('foo'), array('FOO'));
  20  
  21      $this->assertFalse($list->isValid());
  22  
  23      $errors = $list->export();
  24      $this->assertEqual(sizeof($errors), 1);
  25      $this->assertEqual($errors[0]->getMessage(), $message);
  26      $this->assertEqual($errors[0]->getFields(), array('foo'));
  27      $this->assertEqual($errors[0]->getValues(), array('FOO'));
  28    }
  29  }
  30  ?>


Generated: Tue Oct 7 05:02:03 2008 Cross-referenced by PHPXref 0.7