[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/web_app/tests/cases/plain/fetcher/ -> lmbFlashBoxMessagesFetcherTest.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/web_app/src/fetcher/lmbFlashBoxMessagesFetcher.class.php');
  10  lmb_require('limb/web_app/tests/cases/lmbWebAppTestCase.class.php');
  11  
  12  class lmbFlashBoxMessagesFetcherTest extends lmbWebAppTestCase
  13  {
  14    function setUp()
  15    {
  16      parent :: setUp();
  17      $this->_cleanUp();
  18    }
  19  
  20    function tearDown()
  21    {
  22      $this->_cleanUp();
  23      parent :: tearDown();
  24    }
  25  
  26    function _cleanUp()
  27    {
  28       $this->toolkit->getFlashBox()->reset();
  29    }
  30  
  31    function testFetch()
  32    {
  33      $this->toolkit->getFlashBox()->addMessage('Message1');
  34      $this->toolkit->getFlashBox()->addMessage('Message2');
  35  
  36      $fetcher = new lmbFlashBoxMessagesFetcher();
  37      $rs = $fetcher->fetch();
  38  
  39      $rs->rewind();
  40      $this->assertEqual($rs->current()->get('message'), 'Message1');
  41      $rs->next();
  42      $this->assertEqual($rs->current()->get('message'), 'Message2');
  43    }
  44  
  45    function testFetcherResetsMessagesList()
  46    {
  47      $this->toolkit->getFlashBox()->addMessage('Message1');
  48      $this->toolkit->getFlashBox()->addMessage('Message2');
  49  
  50      $fetcher = new lmbFlashBoxMessagesFetcher();
  51      $rs = $fetcher->fetch();
  52  
  53      $rs = $fetcher->fetch();
  54      $rs->rewind();
  55      $this->assertFalse($rs->valid());
  56    }
  57  }
  58  ?>


Generated: Tue Oct 14 04:47:40 2008 Cross-referenced by PHPXref 0.7