You are here

public function PhpBridgeSessionStorageTest::testClear in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php \Symfony\Component\HttpFoundation\Tests\Session\Storage\PhpBridgeSessionStorageTest::testClear()

File

vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php, line 110

Class

PhpBridgeSessionStorageTest
Test class for PhpSessionStorage.

Namespace

Symfony\Component\HttpFoundation\Tests\Session\Storage

Code

public function testClear() {
  $storage = $this
    ->getStorage();
  session_start();
  $_SESSION['drak'] = 'loves symfony';
  $storage
    ->getBag('attributes')
    ->set('symfony', 'greatness');
  $key = $storage
    ->getBag('attributes')
    ->getStorageKey();
  $this
    ->assertEquals($_SESSION[$key], array(
    'symfony' => 'greatness',
  ));
  $this
    ->assertEquals($_SESSION['drak'], 'loves symfony');
  $storage
    ->clear();
  $this
    ->assertEquals($_SESSION[$key], array());
  $this
    ->assertEquals($_SESSION['drak'], 'loves symfony');
}