You are here

public function NativeFileSessionHandlerTest::testConstruct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php \Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler\NativeFileSessionHandlerTest::testConstruct()

File

vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php, line 27

Class

NativeFileSessionHandlerTest
Test class for NativeFileSessionHandler.

Namespace

Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler

Code

public function testConstruct() {
  $storage = new NativeSessionStorage(array(
    'name' => 'TESTING',
  ), new NativeFileSessionHandler(sys_get_temp_dir()));
  if (PHP_VERSION_ID < 50400) {
    $this
      ->assertEquals('files', $storage
      ->getSaveHandler()
      ->getSaveHandlerName());
    $this
      ->assertEquals('files', ini_get('session.save_handler'));
  }
  else {
    $this
      ->assertEquals('files', $storage
      ->getSaveHandler()
      ->getSaveHandlerName());
    $this
      ->assertEquals('user', ini_get('session.save_handler'));
  }
  $this
    ->assertEquals(sys_get_temp_dir(), ini_get('session.save_path'));
  $this
    ->assertEquals('TESTING', ini_get('session.name'));
}