function SqlModeTest::getDatabaseConnectionInfo

Same name and namespace in other branches
  1. 9 core/modules/mysql/tests/src/Kernel/mysql/SqlModeTest.php \Drupal\Tests\mysql\Kernel\mysql\SqlModeTest::getDatabaseConnectionInfo()
  2. 10 core/modules/mysql/tests/src/Kernel/mysql/SqlModeTest.php \Drupal\Tests\mysql\Kernel\mysql\SqlModeTest::getDatabaseConnectionInfo()

Overrides KernelTestBase::getDatabaseConnectionInfo

File

core/modules/mysql/tests/src/Kernel/mysql/SqlModeTest.php, line 29

Class

SqlModeTest
Tests compatibility of the MySQL driver with various sql_mode options.

Namespace

Drupal\Tests\mysql\Kernel\mysql

Code

protected function getDatabaseConnectionInfo() {
    $info = parent::getDatabaseConnectionInfo();
    // This runs during setUp(), so is not yet skipped for non MySQL databases.
    // We defer skipping the test to later in setUp(), so that that can be
    // based on databaseType() rather than 'driver', but here all we have to go
    // on is 'driver'.
    if ($info['default']['driver'] === 'mysql') {
        $info['default']['init_commands']['sql_mode'] = "SET sql_mode = ''";
    }
    return $info;
}

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