l10n_server-2.x-dev/l10n_migrate/tests/fixtures/localize7_l10n_server_translation.php
l10n_migrate/tests/fixtures/localize7_l10n_server_translation.php
<?php // phpcs:ignoreFile /** * @file * A database agnostic dump for testing purposes. * * This file is based on one generated by the Drupal 10.1.5 db-tools.php * script. */ use Drupal\Core\Database\Database; use Drupal\Tests\l10n_migrate\Kernel\MigrateL10nServerTranslationTest as MigrateL10nTestAlias; $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('l10n_server_translation', array( 'fields' => array( 'tid' => array( 'type' => 'serial', 'not null' => TRUE, 'size' => 'normal', ), 'sid' => array( 'type' => 'int', 'not null' => TRUE, 'size' => 'normal', ), 'language' => array( 'type' => 'varchar', 'not null' => TRUE, 'length' => '12', ), 'translation' => array( 'type' => 'text', 'not null' => TRUE, 'size' => 'normal', ), 'uid_entered' => array( 'type' => 'int', 'not null' => TRUE, 'size' => 'normal', 'default' => '0', ), 'time_entered' => array( 'type' => 'int', 'not null' => TRUE, 'size' => 'normal', 'default' => '0', ), 'is_suggestion' => array( 'type' => 'int', 'not null' => TRUE, 'size' => 'normal', 'default' => '0', ), 'is_active' => array( 'type' => 'int', 'not null' => TRUE, 'size' => 'normal', 'default' => '0', ), 'time_changed' => array( 'type' => 'int', 'not null' => TRUE, 'size' => 'normal', 'default' => '0', ), ), 'primary key' => array( 'tid', ), 'indexes' => array( 'uid_entered' => array( 'uid_entered', ), 'is_suggestion_is_active_language' => array( 'is_suggestion', 'is_active', 'language', ), 'sid_language_is_suggestion_is_active' => array( 'sid', 'language', 'is_suggestion', 'is_active', ), ), 'mysql_character_set' => 'utf8mb4', )); $rows = MigrateL10nTestAlias::expectedDataTable(); foreach ($rows as $row) { $connection->insert('l10n_server_translation') ->fields(array_keys(current($rows))) ->values($row) ->execute(); } // Reset the SQL mode. if ($connection->databaseType() === 'mysql') { $connection->query("SET sql_mode = '$sql_mode'"); }