You are here

public function SettingsTest::testGetApcuPrefix in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Site/SettingsTest.php \Drupal\Tests\Core\Site\SettingsTest::testGetApcuPrefix()
  2. 9 core/tests/Drupal/Tests/Core/Site/SettingsTest.php \Drupal\Tests\Core\Site\SettingsTest::testGetApcuPrefix()

Tests Settings::getApcuPrefix().

@covers ::getApcuPrefix

File

core/tests/Drupal/Tests/Core/Site/SettingsTest.php, line 123

Class

SettingsTest
@coversDefaultClass \Drupal\Core\Site\Settings @runTestsInSeparateProcesses @group Site

Namespace

Drupal\Tests\Core\Site

Code

public function testGetApcuPrefix() {
  $settings = new Settings([
    'hash_salt' => 123,
    'apcu_ensure_unique_prefix' => TRUE,
  ]);
  $this
    ->assertNotEquals($settings::getApcuPrefix('cache_test', '/test/a'), $settings::getApcuPrefix('cache_test', '/test/b'));
  $settings = new Settings([
    'hash_salt' => 123,
    'apcu_ensure_unique_prefix' => FALSE,
  ]);
  $this
    ->assertNotEquals($settings::getApcuPrefix('cache_test', '/test/a'), $settings::getApcuPrefix('cache_test', '/test/b'));
}