_cleanUp(); } function tearDown() { $this->_cleanUp(); parent :: tearDown(); } function _cleanUp() { $this->toolkit->getFlashBox()->reset(); } function testGetDatasetErrorsComeFirst() { $this->toolkit->getFlashBox()->addMessage('Message1'); $this->toolkit->getFlashBox()->addError('Error2'); $fetcher = new lmbFlashBoxFetcher(); $rs = $fetcher->fetch(); $rs->rewind(); $this->assertFalse($rs->current()->get('is_message')); $this->assertTrue($rs->current()->get('is_error')); $this->assertEqual($rs->current()->get('message'), 'Error2'); $rs->next(); $this->assertTrue($rs->current()->get('is_message')); $this->assertFalse($rs->current()->get('is_error')); $this->assertEqual($rs->current()->get('message'), 'Message1'); } function testFetcherResetsMessagesList() { $this->toolkit->getFlashBox()->addMessage('Message1'); $this->toolkit->getFlashBox()->addError('Error2'); $fetcher = new lmbFlashBoxFetcher(); $rs = $fetcher->fetch(); $rs = $fetcher->fetch(); $rs->rewind(); $this->assertFalse($rs->valid()); } } ?>