function SettingsTest::testGetApcuPrefix

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Site/SettingsTest.php \Drupal\Tests\Core\Site\SettingsTest::testGetApcuPrefix()
  2. 10 core/tests/Drupal/Tests/Core/Site/SettingsTest.php \Drupal\Tests\Core\Site\SettingsTest::testGetApcuPrefix()
  3. 11.x 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'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.