public function SessionTest::testGetFlashesWithArray

File

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

Class

SessionTest
SessionTest

Namespace

Symfony\Component\HttpFoundation\Tests\Session

Code

public function testGetFlashesWithArray() {
  $array = array(
    'notice' => 'hello',
    'error' => 'none',
  );
  $this
    ->assertEquals(array(), $this->session
    ->getFlashes());
  $this->session
    ->setFlash('foo', $array);
  $this
    ->assertEquals(array(
    'foo' => $array,
  ), $this->session
    ->getFlashes());
  $this
    ->assertEquals(array(), $this->session
    ->getFlashes());
  $array = array(
    'hello',
    'foo',
  );
  $this
    ->assertEquals(array(), $this->session
    ->getFlashes());
  $this->session
    ->setFlash('foo', $array);
  $this
    ->assertEquals(array(
    'foo' => 'hello',
  ), $this->session
    ->getFlashes());
  $this
    ->assertEquals(array(), $this->session
    ->getFlashes());
}