function PhpStorageFactoryTest::setSettings

Same name in other branches
  1. 9 core/modules/system/tests/src/Kernel/PhpStorage/PhpStorageFactoryTest.php \Drupal\Tests\system\Kernel\PhpStorage\PhpStorageFactoryTest::setSettings()
  2. 10 core/modules/system/tests/src/Kernel/PhpStorage/PhpStorageFactoryTest.php \Drupal\Tests\system\Kernel\PhpStorage\PhpStorageFactoryTest::setSettings()
  3. 11.x core/modules/system/tests/src/Kernel/PhpStorage/PhpStorageFactoryTest.php \Drupal\Tests\system\Kernel\PhpStorage\PhpStorageFactoryTest::setSettings()

Sets the Settings() singleton.

Parameters

string $name: The storage bin name to set.

array $configuration: An array of configuration to set. Will be merged with default values.

2 calls to PhpStorageFactoryTest::setSettings()
PhpStorageFactoryTest::testGetDefault in core/modules/system/tests/src/Kernel/PhpStorage/PhpStorageFactoryTest.php
Tests the get() method using the 'default' settings.
PhpStorageFactoryTest::testGetOverride in core/modules/system/tests/src/Kernel/PhpStorage/PhpStorageFactoryTest.php
Tests the get() method with overridden settings.

File

core/modules/system/tests/src/Kernel/PhpStorage/PhpStorageFactoryTest.php, line 95

Class

PhpStorageFactoryTest
Tests the PHP storage factory.

Namespace

Drupal\Tests\system\Kernel\PhpStorage

Code

protected function setSettings($name = 'default', array $configuration = []) {
    $settings['php_storage'][$name] = $configuration + [
        'class' => 'Drupal\\system\\PhpStorage\\MockPhpStorage',
        'directory' => 'tmp://',
        'secret' => $this->randomString(),
        'bin' => 'test',
    ];
    $settings['hash_salt'] = 'mock hash salt';
    new Settings($settings);
}

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