You are here

protected function PhpStorageFactoryTest::setSettings in Drupal 8

Same name and namespace in other branches
  1. 9 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);
}