function Mysql8RequirePrimaryKeyUpdateTest::runDbTasks
Same name in other branches
- 9 core/modules/user/tests/src/Functional/Mysql8RequirePrimaryKeyUpdateTest.php \Drupal\Tests\user\Functional\Mysql8RequirePrimaryKeyUpdateTest::runDbTasks()
- 10 core/modules/mysql/tests/src/Functional/Mysql8RequirePrimaryKeyUpdateTest.php \Drupal\Tests\mysql\Functional\Mysql8RequirePrimaryKeyUpdateTest::runDbTasks()
Overrides UpdatePathTestBase::runDbTasks
File
-
core/
modules/ mysql/ tests/ src/ Functional/ Mysql8RequirePrimaryKeyUpdateTest.php, line 23
Class
- Mysql8RequirePrimaryKeyUpdateTest
- Tests updates MySQL 8 when sql_require_primary_key is on.
Namespace
Drupal\Tests\mysql\FunctionalCode
protected function runDbTasks() {
parent::runDbTasks();
$database = Database::getConnection();
$is_maria = method_exists($database, 'isMariaDb') && $database->isMariaDb();
if ($database->databaseType() !== 'mysql' || $is_maria || version_compare($database->version(), '8.0.13', '<')) {
$this->markTestSkipped('This test only runs on MySQL 8.0.13 and above');
}
$database->query("SET sql_require_primary_key = 1;")
->execute();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.