public function testGetSetFlashes() { $array = array('notice' => 'hello', 'error' => 'none'); $this->assertEquals(array(), $this->session->getFlashes()); $this->session->setFlashes($array); $this->assertEquals($array, $this->session->getFlashes()); $this->assertEquals(array(), $this->session->getFlashes()); }
public function testGetSetFlashes() { $array = array('notice' => 'hello', 'error' => 'none'); $this->assertEquals(array(), $this->session->getFlashes()); $this->session->setFlashes($array); $this->assertEquals($array, $this->session->getFlashes()); $this->assertEquals(array(), $this->session->getFlashes()); $this->session->getFlashBag()->add('notice', 'foo'); // test that BC works by only retrieving the first added. $this->session->getFlashBag()->add('notice', 'foo2'); $this->assertEquals(array('notice' => 'foo'), $this->session->getFlashes()); }
public function testGetSetFlashes() { set_error_handler(array($this, "deprecationErrorHandler")); $array = array('notice' => 'hello', 'error' => 'none'); $this->assertEquals(array(), $this->session->getFlashes()); $this->session->setFlashes($array); $this->assertEquals($array, $this->session->getFlashes()); $this->assertEquals(array(), $this->session->getFlashes()); $this->session->getFlashBag()->add('notice', 'foo'); // test that BC works by only retrieving the first added. $this->session->getFlashBag()->add('notice', 'foo2'); $this->assertEquals(array('notice' => 'foo'), $this->session->getFlashes()); restore_error_handler(); }