From f97233522a6154c74289a5e2574a92ada60da91a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kurucz=20Istv=C3=A1n?= <never@nevergone.hu> Date: Sun, 24 Apr 2022 02:37:03 +0200 Subject: [PATCH] improve fixture file --- tests/fixtures/drupal5.php | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/tests/fixtures/drupal5.php b/tests/fixtures/drupal5.php index c6ec15f..528bc97 100644 --- a/tests/fixtures/drupal5.php +++ b/tests/fixtures/drupal5.php @@ -4,12 +4,18 @@ * @file * A database agnostic dump for testing purposes. * - * This file was generated by the Drupal 9.2.7 db-tools.php script. + * This file was generated by the Drupal 9.3.12 db-tools.php script. */ use Drupal\Core\Database\Database; $connection = Database::getConnection(); +// Ensure any tables with a serial column with a value of 0 are created as +// expected. +if ($connection->databaseType() === 'mysql') { + $sql_mode = $connection->query("SELECT @@sql_mode;")->fetchField(); + $connection->query("SET sql_mode = '$sql_mode,NO_AUTO_VALUE_ON_ZERO'"); +} $connection->schema()->createTable('access', array( 'fields' => array( @@ -2084,15 +2090,21 @@ $connection->insert('filter_formats') ->values(array( 'format' => '3', 'name' => 'Full HTML', - 'roles' => '', + 'roles' => ',4,', 'cache' => '1', )) ->values(array( 'format' => '4', 'name' => 'PHP code', - 'roles' => ',,', + 'roles' => ',6,3,', 'cache' => '0', )) +->values(array( + 'format' => '5', + 'name' => 'Empty input format', + 'roles' => ',,', + 'cache' => '1', +)) ->execute(); $connection->schema()->createTable('filters', array( 'fields' => array( @@ -2157,14 +2169,14 @@ $connection->insert('filters') ->values(array( 'format' => '3', 'module' => 'filter', - 'delta' => '3', - 'weight' => '0', + 'delta' => '2', + 'weight' => '1', )) ->values(array( 'format' => '3', 'module' => 'filter', - 'delta' => '2', - 'weight' => '1', + 'delta' => '3', + 'weight' => '0', )) ->values(array( 'format' => '4', @@ -7104,6 +7116,10 @@ $connection->insert('variable') 'name', 'value', )) +->values(array( + 'name' => 'admin_theme', + 'value' => 's:1:"0";', +)) ->values(array( 'name' => 'clean_url', 'value' => 's:1:"1";', @@ -7481,3 +7497,8 @@ $connection->schema()->createTable('watchdog', array( ), 'mysql_character_set' => 'utf8', )); + +// Reset the SQL mode. +if ($connection->databaseType() === 'mysql') { + $connection->query("SET sql_mode = '$sql_mode'"); +} -- GitLab