public function SessionTest::testGetSetFlash

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php, line 200

Class

SessionTest
SessionTest

Namespace

Symfony\Component\HttpFoundation\Tests\Session

Code

public function testGetSetFlash() {
  $this
    ->assertNull($this->session
    ->getFlash('notice'));
  $this
    ->assertEquals('default', $this->session
    ->getFlash('notice', 'default'));
  $this->session
    ->getFlashBag()
    ->add('notice', 'foo');
  $this->session
    ->getFlashBag()
    ->add('notice', 'foo2');

  // test that BC works by only retrieving the first added.
  $this
    ->assertEquals('foo', $this->session
    ->getFlash('notice'));
  $this
    ->assertNull($this->session
    ->getFlash('notice'));
}