Exemplo n.º 1
0
 /**
  * Test Flash sets messages for current request
  *
  * Pre-conditions:
  * Messages are loaded from $_SESSION;
  * Message set using now();
  * Message set using set();
  *
  * Post-conditions:
  * Flash messages for current request are equal to those
  * pulled from $_SESSION and the one set using now(). The
  * message set using set() is ignored until next request.
  */
 public function testFlashSetsMessagesForNow()
 {
     $f1 = new Slim_Session_Flash();
     $f1->now('error', 'Error message');
     $f1->set('later', 'Message for next request');
     $msgs = $f1->getMessages();
     $this->assertEquals(2, count($msgs));
     $this->assertArrayHasKey('info', $msgs);
     //From $_SESSION
     $this->assertArrayHasKey('error', $msgs);
     //From now()
 }