function Mysql8RequirePrimaryKeyUpdateTest::prepareSettings

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

Overrides UpdatePathTestBase::prepareSettings

File

core/modules/user/tests/src/Functional/Mysql8RequirePrimaryKeyUpdateTest.php, line 32

Class

Mysql8RequirePrimaryKeyUpdateTest
Tests user_update_9301() on MySQL 8 when sql_require_primary_key is on.

Namespace

Drupal\Tests\user\Functional

Code

protected function prepareSettings() {
    parent::prepareSettings();
    // Set sql_require_primary_key for any future connections.
    $settings['databases']['default']['default']['init_commands'] = (object) [
        'value' => [
            'sql_require_primary_key' => 'SET sql_require_primary_key = 1;',
        ],
        'required' => TRUE,
    ];
    $this->writeSettings($settings);
}

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