public function SessionTest::testClearFlashes

File

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

Class

SessionTest
SessionTest

Namespace

Symfony\Component\HttpFoundation\Tests\Session

Code

public function testClearFlashes() {
  $this
    ->assertFalse($this->session
    ->hasFlash('notice'));
  $this
    ->assertFalse($this->session
    ->hasFlash('error'));
  $this->session
    ->setFlash('notice', 'foo');
  $this->session
    ->setFlash('error', 'bar');
  $this
    ->assertTrue($this->session
    ->hasFlash('notice'));
  $this
    ->assertTrue($this->session
    ->hasFlash('error'));
  $this->session
    ->clearFlashes();
  $this
    ->assertFalse($this->session
    ->hasFlash('notice'));
  $this
    ->assertFalse($this->session
    ->hasFlash('error'));
}