[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/web_app/tests/cases/ -> lmbWebAppTestCase.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  
  10  lmb_require('limb/dbal/src/lmbSimpleDb.class.php');
  11  
  12  class lmbWebAppTestCase extends UnitTestCase
  13  {
  14    protected $toolkit;
  15    protected $request;
  16    protected $response;
  17    protected $db;
  18    protected $connection;
  19  
  20    function setUp()
  21    {
  22      $this->toolkit = lmbToolkit :: save();
  23      $this->request = $this->toolkit->getRequest();
  24      $this->response = $this->toolkit->getResponse();
  25      $this->session = $this->toolkit->getSession();
  26      $this->session->reset();
  27      $this->connection = $this->toolkit->getDefaultDbConnection();
  28      $this->db = new lmbSimpleDb($this->connection);
  29    }
  30  
  31    function tearDown()
  32    {
  33      lmbToolkit :: restore();
  34    }
  35  
  36    function assertCommandValid($command, $line)
  37    {
  38      if($this->assertTrue($command->isValid()))
  39        return true;
  40  
  41      $errors = array();
  42      foreach($command->getErrorList() as $error)
  43        $errors[] .= ' ' .  $error->get();
  44      $error_text = implode(', ', $errors);
  45      $this->assertTrue(false, 'Command is not valid with following errors: '. $error_text . ' at line '. $line);
  46  
  47      return false;
  48    }
  49  }
  50  ?>


Generated: Wed Oct 15 04:31:08 2008 Cross-referenced by PHPXref 0.7