function RequirementsTest::writeIsolationLevelSettings

Same name and namespace in other branches
  1. 10 core/modules/mysql/tests/src/Functional/RequirementsTest.php \Drupal\Tests\mysql\Functional\RequirementsTest::writeIsolationLevelSettings()
  2. 11.x core/modules/mysql/tests/src/Functional/RequirementsTest.php \Drupal\Tests\mysql\Functional\RequirementsTest::writeIsolationLevelSettings()

Writes the isolation level in settings.php.

Parameters

string $isolation_level: The isolation level.

1 call to RequirementsTest::writeIsolationLevelSettings()
RequirementsTest::testIsolationLevelWarningNotDisplaying in core/modules/mysql/tests/src/Functional/RequirementsTest.php
Test the isolation level warning message on status page.

File

core/modules/mysql/tests/src/Functional/RequirementsTest.php, line 81

Class

RequirementsTest
Tests isolation level warning when the config is set in settings.php.

Namespace

Drupal\Tests\mysql\Functional

Code

private function writeIsolationLevelSettings(string $isolation_level) {
    $settings['databases']['default']['default']['init_commands'] = (object) [
        'value' => [
            'isolation' => "SET SESSION TRANSACTION ISOLATION LEVEL {$isolation_level}",
        ],
        'required' => TRUE,
    ];
    $this->writeSettings($settings);
}

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