Commit 78cc7d8b authored by alexpott's avatar alexpott

Issue #2469623 by phenaproxima, ultimike, amateescu, mrjmd, douggreen, chx,...

Issue #2469623 by phenaproxima, ultimike, amateescu, mrjmd, douggreen, chx, benjy: Process for creating migration source DBs for automated tests
parent 554034ac
<?php
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\MigrateTableDumpTest.
*/
namespace Drupal\migrate_drupal\Tests;
use Drupal\simpletest\KernelTestBase;
/**
* Validates the table dumps.
*
* @group migrate_drupal
*/
class MigrateTableDumpTest extends KernelTestBase {
protected function verifyDumpFiles($directory) {
$tables = file_scan_directory($directory, '/.php$/');
foreach ($tables as $table) {
$contents = rtrim(file_get_contents($table->uri));
$this->assertIdentical(substr($contents, -32), md5(substr($contents, 0, -33)), $table->uri);
}
}
public function testMigrateDrupal6TableDumps() {
$this->verifyDumpFiles(__DIR__ . '/Table/d6');
}
public function testMigrateDrupal7TableDumps() {
$this->verifyDumpFiles(__DIR__ . '/Table/d7');
}
}
......@@ -2,11 +2,11 @@
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Dump\Access.
* Contains \Drupal\migrate_drupal\Tests\Table\d6\Access.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see cores/scripts/dump-database-d6.sh
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
......@@ -45,7 +45,7 @@ public function load() {
'status' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '4',
'length' => '11',
'default' => '0',
),
),
......@@ -60,3 +60,4 @@ public function load() {
}
}
#906d752540b89c65dcab417eeb749669
......@@ -2,11 +2,11 @@
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Dump\Actions.
* Contains \Drupal\migrate_drupal\Tests\Table\d6\Actions.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see cores/scripts/dump-database-d6.sh
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
......@@ -133,3 +133,4 @@ public function load() {
}
}
#8839ba77a788fdd11f0097242a686408
......@@ -2,11 +2,11 @@
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Dump\ActionsAid.
* Contains \Drupal\migrate_drupal\Tests\Table\d6\ActionsAid.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see cores/scripts/dump-database-d6.sh
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
......@@ -40,3 +40,4 @@ public function load() {
}
}
#1c907838b8bafd88d0d3141fe32b41f6
......@@ -2,11 +2,11 @@
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Dump\AggregatorCategory.
* Contains \Drupal\migrate_drupal\Tests\Table\d6\AggregatorCategory.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see cores/scripts/dump-database-d6.sh
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
......@@ -44,7 +44,7 @@ public function load() {
'block' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '4',
'length' => '11',
'default' => '0',
),
),
......@@ -59,3 +59,4 @@ public function load() {
}
}
#f9b4a42a7a6c1f7bd027bd95c1a4ef83
......@@ -2,11 +2,11 @@
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Dump\AggregatorFeed.
* Contains \Drupal\migrate_drupal\Tests\Table\d6\AggregatorFeed.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see cores/scripts/dump-database-d6.sh
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
......@@ -85,7 +85,7 @@ public function load() {
'block' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '4',
'length' => '11',
'default' => '0',
),
),
......@@ -119,3 +119,4 @@ public function load() {
}
}
#57eeb4c900631cda398a543689a156cb
......@@ -2,11 +2,11 @@
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Dump\AggregatorItem.
* Contains \Drupal\migrate_drupal\Tests\Table\d6\AggregatorItem.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see cores/scripts/dump-database-d6.sh
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
......@@ -94,3 +94,4 @@ public function load() {
}
}
#1164613d3b2596dfdfddefdc52da8bc7
......@@ -2,11 +2,11 @@
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Dump\Authmap.
* Contains \Drupal\migrate_drupal\Tests\Table\d6\Authmap.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see cores/scripts/dump-database-d6.sh
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
......@@ -61,3 +61,4 @@ public function load() {
}
}
#291a74a5eac3448929eccb583ec5b6bb
......@@ -2,11 +2,11 @@
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Dump\Batch.
* Contains \Drupal\migrate_drupal\Tests\Table\d6\Batch.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see cores/scripts/dump-database-d6.sh
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
......@@ -58,3 +58,4 @@ public function load() {
}
}
#28b4106c5eefd0a82f2fdc6d870fde78
......@@ -2,11 +2,11 @@
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Dump\Blocks.
* Contains \Drupal\migrate_drupal\Tests\Table\d6\Blocks.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see cores/scripts/dump-database-d6.sh
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
......@@ -51,13 +51,13 @@ public function load() {
'status' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '4',
'length' => '11',
'default' => '0',
),
'weight' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '4',
'length' => '11',
'default' => '0',
),
'region' => array(
......@@ -69,19 +69,19 @@ public function load() {
'custom' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '4',
'length' => '11',
'default' => '0',
),
'throttle' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '4',
'length' => '11',
'default' => '0',
),
'visibility' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '4',
'length' => '11',
'default' => '0',
),
'pages' => array(
......@@ -98,7 +98,7 @@ public function load() {
'cache' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '4',
'length' => '11',
'default' => '1',
),
),
......@@ -402,3 +402,4 @@ public function load() {
}
}
#1f4dbdf6b524a1b4ddea8cbb306caf19
......@@ -2,11 +2,11 @@
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Dump\BlocksRoles.
* Contains \Drupal\migrate_drupal\Tests\Table\d6\BlocksRoles.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see cores/scripts/dump-database-d6.sh
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
......@@ -62,3 +62,4 @@ public function load() {
}
}
#29243885f79abad280834034dca71856
......@@ -2,11 +2,11 @@
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Dump\Book.
* Contains \Drupal\migrate_drupal\Tests\Table\d6\Book.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see cores/scripts/dump-database-d6.sh
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
......@@ -77,3 +77,4 @@ public function load() {
}
}
#a91ece4a284d1ba43d247d623edd7a74
......@@ -2,11 +2,11 @@
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Dump\Boxes.
* Contains \Drupal\migrate_drupal\Tests\Table\d6\Boxes.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see cores/scripts/dump-database-d6.sh
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
......@@ -45,7 +45,7 @@ public function load() {
'format' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '6',
'length' => '11',
'default' => '0',
),
),
......@@ -70,3 +70,4 @@ public function load() {
}
}
#fc7fbf9ec57c0c76fceab84ab55b9da8
<?php
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Table\d6\Cache.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
namespace Drupal\migrate_drupal\Tests\Table\d6;
use Drupal\migrate_drupal\Tests\Dump\DrupalDumpBase;
/**
* Generated file to represent the cache table.
*/
class Cache extends DrupalDumpBase {
public function load() {
$this->createTable("cache", array(
'primary key' => array(
'cid',
),
'fields' => array(
'cid' => array(
'type' => 'varchar',
'not null' => TRUE,
'length' => '255',
'default' => '',
),
'data' => array(
'type' => 'blob',
'not null' => FALSE,
'length' => 100,
),
'expire' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '11',
'default' => '0',
),
'created' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '11',
'default' => '0',
),
'headers' => array(
'type' => 'text',
'not null' => FALSE,
'length' => 100,
),
'serialized' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '11',
'default' => '0',
),
),
));
$this->database->insert("cache")->fields(array(
'cid',
'data',
'expire',
'created',
'headers',
'serialized',
))
->execute();
}
}
#a2937f7bc1d1a464b3497945341caba4
<?php
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Table\d6\CacheBlock.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
namespace Drupal\migrate_drupal\Tests\Table\d6;
use Drupal\migrate_drupal\Tests\Dump\DrupalDumpBase;
/**
* Generated file to represent the cache_block table.
*/
class CacheBlock extends DrupalDumpBase {
public function load() {
$this->createTable("cache_block", array(
'primary key' => array(
'cid',
),
'fields' => array(
'cid' => array(
'type' => 'varchar',
'not null' => TRUE,
'length' => '255',
'default' => '',
),
'data' => array(
'type' => 'blob',
'not null' => FALSE,
'length' => 100,
),
'expire' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '11',
'default' => '0',
),
'created' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '11',
'default' => '0',
),
'headers' => array(
'type' => 'text',
'not null' => FALSE,
'length' => 100,
),
'serialized' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '11',
'default' => '0',
),
),
));
$this->database->insert("cache_block")->fields(array(
'cid',
'data',
'expire',
'created',
'headers',
'serialized',
))
->execute();
}
}
#e14abfc02ee25adc633afe98b414ca08
<?php
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Table\d6\CacheBootstrap.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
namespace Drupal\migrate_drupal\Tests\Table\d6;
use Drupal\migrate_drupal\Tests\Dump\DrupalDumpBase;
/**
* Generated file to represent the cache_bootstrap table.
*/
class CacheBootstrap extends DrupalDumpBase {
public function load() {
$this->createTable("cache_bootstrap", array(
'primary key' => array(
'cid',
),
'fields' => array(
'cid' => array(
'type' => 'varchar',
'not null' => TRUE,
'length' => '255',
'default' => '',
),
'data' => array(
'type' => 'blob',
'not null' => FALSE,
'length' => 100,
),
'expire' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '11',
'default' => '0',
),
'created' => array(
'type' => 'numeric',
'not null' => TRUE,
'precision' => '14',
'scale' => '3',
'default' => '0.000',
),
'serialized' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '11',
'default' => '0',
),
'tags' => array(
'type' => 'text',
'not null' => FALSE,
'length' => 100,
),
'checksum_invalidations' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '11',
'default' => '0',
),
'checksum_deletions' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '11',
'default' => '0',
),
),
));
$this->database->insert("cache_bootstrap")->fields(array(
'cid',
'data',
'expire',
'created',
'serialized',
'tags',
'checksum_invalidations',
'checksum_deletions',
))
->execute();
}
}
#fca41159793677ed4462364018ae2af2
<?php
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Table\d6\CacheConfig.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
namespace Drupal\migrate_drupal\Tests\Table\d6;
use Drupal\migrate_drupal\Tests\Dump\DrupalDumpBase;
/**
* Generated file to represent the cache_config table.
*/
class CacheConfig extends DrupalDumpBase {
public function load() {
$this->createTable("cache_config", array(
'primary key' => array(
'cid',
),
'fields' => array(
'cid' => array(
'type' => 'varchar',
'not null' => TRUE,
'length' => '255',
'default' => '',
),
'data' => array(
'type' => 'blob',
'not null' => FALSE,
'length' => 100,
),
'expire' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '11',
'default' => '0',
),
'created' => array(
'type' => 'numeric',
'not null' => TRUE,
'precision' => '14',
'scale' => '3',
'default' => '0.000',
),
'serialized' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '11',
'default' => '0',
),
'tags' => array(
'type' => 'text',
'not null' => FALSE,
'length' => 100,
),
'checksum_invalidations' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '11',
'default' => '0',
),
'checksum_deletions' => array(
'type' => 'int',
'not null' => TRUE,
'length' => '11',
'default' => '0',
),
),
));
$this->database->insert("cache_config")->fields(array(
'cid',
'data',
'expire',
'created',
'serialized',
'tags',
'checksum_invalidations',
'checksum_deletions',
))
->execute();
}
}
#f438fd9400357de86c6fd107fc245404
<?php
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Table\d6\CacheContent.
*
* THIS IS A GENERATED FILE. DO NOT EDIT.
*
* @see core/scripts/migrate-db.sh
* @see https://www.drupal.org/sandbox/benjy/2405029
*/
namespace Drupal\migrate_drupal\Tests\Table\d6;