You are here

public function SessionStoreTest::testCustomSessionBaseName in Auth0 Single Sign On 8.2

Test that custom base names can be set and return the correct value.

@runInSeparateProcess

Return value

void

File

vendor/auth0/auth0-php/tests/Store/SessionStoreTest.php, line 139

Class

SessionStoreTest
Class SessionStoreTest. Tests the SessionStore class.

Code

public function testCustomSessionBaseName() {
  $test_base_name = 'test_base_name';
  self::$sessionStore = new SessionStore($test_base_name);
  $test_this_key_name = self::$sessionStore
    ->getSessionKeyName(self::TEST_KEY);
  $this
    ->assertEquals($test_base_name . '_' . self::TEST_KEY, $test_this_key_name);

  // Suppressing "headers already sent" warning related to cookies.
  // phpcs:ignore
  @self::$sessionStore
    ->set(self::TEST_KEY, self::TEST_VALUE);
  $this
    ->assertEquals(self::TEST_VALUE, self::$sessionStore
    ->get(self::TEST_KEY));
}