From 53741f16a3470fc91166022c1dd90a548f8512fb Mon Sep 17 00:00:00 2001 From: Andreas Hennings Date: Tue, 29 Apr 2014 20:53:57 +0200 Subject: [PATCH 1/7] Refactor Dump classes in migrate_drupal tests. --- .../lib/Drupal/migrate/Tests/MigrateTestBase.php | 36 +----- .../Tests/Dump/Drupal6ActionSettings.php | 10 +- .../Tests/Dump/Drupal6AggregatorFeed.php | 13 ++- .../Tests/Dump/Drupal6AggregatorItem.php | 13 ++- .../Tests/Dump/Drupal6AggregatorSettings.php | 10 +- .../migrate_drupal/Tests/Dump/Drupal6Block.php | 12 +- .../migrate_drupal/Tests/Dump/Drupal6Book.php | 14 ++- .../Tests/Dump/Drupal6BookSettings.php | 10 +- .../migrate_drupal/Tests/Dump/Drupal6Box.php | 10 +- .../migrate_drupal/Tests/Dump/Drupal6Comment.php | 12 +- .../Tests/Dump/Drupal6CommentVariable.php | 17 +-- .../Tests/Dump/Drupal6ContactCategory.php | 13 ++- .../Tests/Dump/Drupal6ContactSettings.php | 10 +- .../Tests/Dump/Drupal6DateFormat.php | 10 +- .../Tests/Dump/Drupal6DblogSettings.php | 10 +- .../Tests/Dump/Drupal6FieldInstance.php | 20 ++-- .../Tests/Dump/Drupal6FieldSettings.php | 10 +- .../migrate_drupal/Tests/Dump/Drupal6File.php | 10 +- .../Tests/Dump/Drupal6FileSettings.php | 10 +- .../Tests/Dump/Drupal6FilterFormat.php | 19 ++-- .../Tests/Dump/Drupal6ForumSettings.php | 10 +- .../Tests/Dump/Drupal6LocaleSettings.php | 10 +- .../migrate_drupal/Tests/Dump/Drupal6Menu.php | 13 ++- .../Tests/Dump/Drupal6MenuSettings.php | 12 +- .../migrate_drupal/Tests/Dump/Drupal6Node.php | 20 ++-- .../Tests/Dump/Drupal6NodeBodyInstance.php | 14 ++- .../Tests/Dump/Drupal6NodeRevision.php | 8 +- .../Tests/Dump/Drupal6NodeSettings.php | 10 +- .../migrate_drupal/Tests/Dump/Drupal6NodeType.php | 17 +-- .../Tests/Dump/Drupal6SearchPage.php | 11 +- .../Tests/Dump/Drupal6SearchSettings.php | 10 +- .../Tests/Dump/Drupal6SimpletestSettings.php | 10 +- .../Tests/Dump/Drupal6StatisticsSettings.php | 10 +- .../Tests/Dump/Drupal6SyslogSettings.php | 10 +- .../Tests/Dump/Drupal6SystemCron.php | 10 +- .../Tests/Dump/Drupal6SystemFile.php | 26 +---- .../Tests/Dump/Drupal6SystemFileStandalone.php | 37 ++++++ .../Tests/Dump/Drupal6SystemFilter.php | 10 +- .../Tests/Dump/Drupal6SystemImage.php | 10 +- .../Tests/Dump/Drupal6SystemImageGd.php | 10 +- .../Tests/Dump/Drupal6SystemMaintenance.php | 10 +- .../Tests/Dump/Drupal6SystemPerformance.php | 10 +- .../migrate_drupal/Tests/Dump/Drupal6SystemRss.php | 10 +- .../Tests/Dump/Drupal6SystemSite.php | 10 +- .../Tests/Dump/Drupal6SystemTheme.php | 10 +- .../Tests/Dump/Drupal6TaxonomySettings.php | 10 +- .../Tests/Dump/Drupal6TaxonomyTerm.php | 17 +-- .../Tests/Dump/Drupal6TaxonomyVocabulary.php | 15 ++- .../migrate_drupal/Tests/Dump/Drupal6TermNode.php | 12 +- .../Tests/Dump/Drupal6TextSettings.php | 10 +- .../Tests/Dump/Drupal6UpdateSettings.php | 10 +- .../migrate_drupal/Tests/Dump/Drupal6Upload.php | 12 +- .../Tests/Dump/Drupal6UploadField.php | 8 +- .../Tests/Dump/Drupal6UploadInstance.php | 20 ++-- .../migrate_drupal/Tests/Dump/Drupal6UrlAlias.php | 10 +- .../migrate_drupal/Tests/Dump/Drupal6User.php | 10 +- .../migrate_drupal/Tests/Dump/Drupal6UserMail.php | 10 +- .../Tests/Dump/Drupal6UserProfileFields.php | 12 +- .../migrate_drupal/Tests/Dump/Drupal6UserRole.php | 10 +- .../Tests/Dump/Drupal6VocabularyField.php | 16 +-- .../migrate_drupal/Tests/Dump/DumpInterface.php | 20 ++++ .../Tests/MigrateDrupal6TestBase.php | 56 +++++++++ .../migrate_drupal/Tests/MigrateDrupalTestBase.php | 15 +-- .../Drupal6DbWrapper.php} | 73 +++++++++--- .../Tests/d6/MigrateActionConfigsTest.php | 11 +- .../Tests/d6/MigrateAggregatorConfigsTest.php | 11 +- .../Tests/d6/MigrateAggregatorFeedTest.php | 11 +- .../Tests/d6/MigrateAggregatorItemTest.php | 10 +- .../migrate_drupal/Tests/d6/MigrateBlockTest.php | 10 +- .../Tests/d6/MigrateBookConfigsTest.php | 11 +- .../migrate_drupal/Tests/d6/MigrateBookTest.php | 11 +- .../Tests/d6/MigrateCckFieldRevisionTest.php | 6 +- .../migrate_drupal/Tests/d6/MigrateCommentTest.php | 12 +- .../Tests/d6/MigrateCommentVariableDisplayBase.php | 19 +--- .../Tests/d6/MigrateCommentVariableField.php | 10 +- .../Tests/d6/MigrateCommentVariableInstance.php | 10 +- .../Tests/d6/MigrateContactCategoryTest.php | 11 +- .../Tests/d6/MigrateContactConfigsTest.php | 11 +- .../Tests/d6/MigrateCustomBlockTest.php | 10 +- .../Tests/d6/MigrateDateFormatTest.php | 11 +- .../Tests/d6/MigrateDblogConfigsTest.php | 11 +- .../migrate_drupal/Tests/d6/MigrateDrupal6Test.php | 126 +++++++++++---------- .../Tests/d6/MigrateFieldConfigsTest.php | 12 +- .../Tests/d6/MigrateFieldFormatterSettingsTest.php | 11 +- .../Tests/d6/MigrateFieldInstanceTest.php | 12 +- .../migrate_drupal/Tests/d6/MigrateFieldTest.php | 10 +- .../Tests/d6/MigrateFieldWidgetSettingsTest.php | 11 +- .../Tests/d6/MigrateFileConfigsTest.php | 11 +- .../migrate_drupal/Tests/d6/MigrateFileTest.php | 18 ++- .../Tests/d6/MigrateFilterFormatTest.php | 11 +- .../Tests/d6/MigrateForumConfigsTest.php | 11 +- .../Tests/d6/MigrateLocaleConfigsTest.php | 11 +- .../Tests/d6/MigrateMenuConfigsTest.php | 11 +- .../migrate_drupal/Tests/d6/MigrateMenuTest.php | 12 +- .../Tests/d6/MigrateNodeConfigsTest.php | 11 +- .../Tests/d6/MigrateNodeRevisionTest.php | 7 +- .../Tests/d6/MigrateNodeTestBase.php | 18 +-- .../Tests/d6/MigrateNodeTypeTest.php | 11 +- .../Tests/d6/MigrateProfileValuesTest.php | 14 +-- .../Tests/d6/MigrateSearchConfigsTest.php | 11 +- .../Tests/d6/MigrateSearchPageTest.php | 11 +- .../Tests/d6/MigrateSimpletestConfigsTest.php | 11 +- .../Tests/d6/MigrateStatisticsConfigsTest.php | 11 +- .../Tests/d6/MigrateSyslogConfigsTest.php | 11 +- .../Tests/d6/MigrateSystemCronTest.php | 11 +- .../Tests/d6/MigrateSystemFileTest.php | 11 +- .../Tests/d6/MigrateSystemFilterTest.php | 11 +- .../Tests/d6/MigrateSystemImageGdTest.php | 11 +- .../Tests/d6/MigrateSystemImageTest.php | 11 +- .../Tests/d6/MigrateSystemMaintenanceTest.php | 11 +- .../Tests/d6/MigrateSystemPerformanceTest.php | 11 +- .../Tests/d6/MigrateSystemRssTest.php | 11 +- .../Tests/d6/MigrateSystemSiteTest.php | 11 +- .../Tests/d6/MigrateSystemThemeTest.php | 11 +- .../Tests/d6/MigrateTaxonomyConfigsTest.php | 11 +- .../Tests/d6/MigrateTaxonomyTermTest.php | 12 +- .../Tests/d6/MigrateTaxonomyVocabularyTest.php | 11 +- .../Tests/d6/MigrateTermNodeTestBase.php | 21 ++-- .../Tests/d6/MigrateTextConfigsTest.php | 11 +- .../Tests/d6/MigrateUpdateConfigsTest.php | 11 +- .../migrate_drupal/Tests/d6/MigrateUploadBase.php | 15 +-- .../Tests/d6/MigrateUploadEntityDisplayTest.php | 11 +- .../d6/MigrateUploadEntityFormDisplayTest.php | 11 +- .../Tests/d6/MigrateUploadFieldTest.php | 11 +- .../Tests/d6/MigrateUploadInstanceTest.php | 11 +- .../Tests/d6/MigrateUrlAliasTest.php | 12 +- .../Tests/d6/MigrateUserConfigsTest.php | 11 +- .../d6/MigrateUserPictureEntityDisplayTest.php | 5 +- .../d6/MigrateUserPictureEntityFormDisplayTest.php | 5 +- .../Tests/d6/MigrateUserPictureFieldTest.php | 5 +- .../Tests/d6/MigrateUserPictureFileTest.php | 10 +- .../Tests/d6/MigrateUserPictureInstanceTest.php | 5 +- .../d6/MigrateUserProfileEntityDisplayTest.php | 10 +- .../d6/MigrateUserProfileEntityFormDisplayTest.php | 10 +- .../d6/MigrateUserProfileFieldInstanceTest.php | 10 +- .../Tests/d6/MigrateUserProfileFieldTest.php | 11 +- .../Tests/d6/MigrateUserRoleTest.php | 12 +- .../migrate_drupal/Tests/d6/MigrateUserTest.php | 22 ++-- .../Tests/d6/MigrateViewModesTest.php | 11 +- .../d6/MigrateVocabularyEntityDisplayTest.php | 11 +- .../d6/MigrateVocabularyEntityFormDisplayTest.php | 11 +- .../d6/MigrateVocabularyFieldInstanceTest.php | 11 +- .../Tests/d6/MigrateVocabularyFieldTest.php | 11 +- .../Tests/dependencies/MigrateDependenciesTest.php | 16 ++- 144 files changed, 1054 insertions(+), 893 deletions(-) create mode 100644 core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFileStandalone.php create mode 100644 core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/DumpInterface.php create mode 100644 core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/MigrateDrupal6TestBase.php rename core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/{Dump/Drupal6DumpBase.php => d6/Drupal6DbWrapper.php} (83%) diff --git a/core/modules/migrate/lib/Drupal/migrate/Tests/MigrateTestBase.php b/core/modules/migrate/lib/Drupal/migrate/Tests/MigrateTestBase.php index 9a4b5bd..d28dc55 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Tests/MigrateTestBase.php +++ b/core/modules/migrate/lib/Drupal/migrate/Tests/MigrateTestBase.php @@ -11,6 +11,8 @@ use Drupal\migrate\Entity\MigrationInterface; use Drupal\migrate\MigrateMessageInterface; use Drupal\migrate\Row; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; +use Drupal\migrate_drupal\Tests\Dump\DumpInterface; use Drupal\simpletest\WebTestBase; class MigrateTestBase extends WebTestBase implements MigrateMessageInterface { @@ -67,40 +69,6 @@ protected function tearDown() { } /** - * Prepare the migration. - * - * @param \Drupal\migrate\Entity\MigrationInterface $migration - * The migration object. - * @param array $files - * An array of files. - */ - protected function prepare(MigrationInterface $migration, array $files = array()) { - $this->loadDumps($files); - } - - /** - * Load Drupal 6 database dumps to be used. - * - * @param array $files - * An array of files. - * @param string $method - * The name of the method in the dump class to use. Defaults to load. - */ - protected function loadDumps($files, $method = 'load') { - // Load the database from the portable PHP dump. - // The files may be gzipped. - foreach ($files as $file) { - if (substr($file, -3) == '.gz') { - $file = "compress.zlib://$file"; - require $file; - } - preg_match('/^namespace (.*);$/m', file_get_contents($file), $matches); - $class = $matches[1] . '\\' . basename($file, '.php'); - (new $class(Database::getConnection('default', 'migrate')))->$method(); - } - } - - /** * Prepare the id mappings. * * @param array $id_mappings diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php index 587a84f..822f363 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing action.settings.yml migration. */ -class Drupal6ActionSettings extends Drupal6DumpBase { +class Drupal6ActionSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php index 5d74e0c..b218b58 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php @@ -6,16 +6,19 @@ */ namespace Drupal\migrate_drupal\Tests\Dump; + +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing feed migration. */ -class Drupal6AggregatorFeed extends Drupal6DumpBase { +class Drupal6AggregatorFeed implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('aggregator_feed', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('aggregator_feed', array( 'description' => 'Stores feeds to be parsed by the aggregator.', 'fields' => array( 'fid' => array( @@ -96,7 +99,7 @@ public function load() { ), )); - $this->database->insert('aggregator_feed')->fields(array( + $dbWrapper->getDbConnection()->insert('aggregator_feed')->fields(array( 'fid', 'title', 'url', @@ -123,7 +126,7 @@ public function load() { 'block' => 5, )) ->execute(); - $this->setModuleVersion('aggregator', 6001); + $dbWrapper->setModuleVersion('aggregator', 6001); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php index b4f1ad2..9a2137d 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php @@ -6,16 +6,19 @@ */ namespace Drupal\migrate_drupal\Tests\Dump; + +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing aggregator item migration. */ -class Drupal6AggregatorItem extends Drupal6DumpBase { +class Drupal6AggregatorItem implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('aggregator_item', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('aggregator_item', array( 'description' => 'Stores the individual items imported from feeds.', 'fields' => array( 'iid' => array( @@ -72,7 +75,7 @@ public function load() { 'indexes' => array('fid' => array('fid')), )); - $this->database->insert('aggregator_item')->fields(array( + $dbWrapper->getDbConnection()->insert('aggregator_item')->fields(array( 'iid', 'fid', 'title', @@ -94,7 +97,7 @@ public function load() { )) ->execute(); - $this->setModuleVersion('aggregator', '6001'); + $dbWrapper->setModuleVersion('aggregator', '6001'); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php index 51bfb9f..59b045d 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing aggregator.settings.yml migration. */ -class Drupal6AggregatorSettings extends Drupal6DumpBase { +class Drupal6AggregatorSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php index 3144fb7..9c5a748 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php @@ -7,13 +7,15 @@ namespace Drupal\migrate_drupal\Tests\Dump; -class Drupal6Block extends Drupal6DumpBase { +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + +class Drupal6Block implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('blocks', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('blocks', array( 'fields' => array( 'bid' => array( 'type' => 'serial', @@ -110,7 +112,7 @@ public function load() { ), ), )); - $this->createTable('blocks_roles', array( + $dbWrapper->createTable('blocks_roles', array( 'fields' => array( 'module' => array( 'type' => 'varchar', @@ -141,7 +143,7 @@ public function load() { 'module' => 'block', 'name' => 'blocks_roles', )); - $this->database->insert('blocks')->fields(array( + $dbWrapper->getDbConnection()->insert('blocks')->fields(array( 'bid', 'module', 'delta', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php index 5ab6f92..921cbb9 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php @@ -7,13 +7,15 @@ namespace Drupal\migrate_drupal\Tests\Dump; -class Drupal6Book extends Drupal6DumpBase { +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + +class Drupal6Book implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('book', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('book', array( 'fields' => array( 'mlid' => array( 'type' => 'int', @@ -50,7 +52,7 @@ public function load() { 'module' => 'book', 'name' => 'book', )); - $this->createTable('menu_links', array( + $dbWrapper->createTable('menu_links', array( 'fields' => array( 'menu_name' => array( 'type' => 'varchar', @@ -238,7 +240,7 @@ public function load() { 'module' => 'system', 'name' => 'menu_links', )); - $this->database->insert('book')->fields(array( + $dbWrapper->getDbConnection()->insert('book')->fields(array( 'mlid', 'nid', 'bid', @@ -269,7 +271,7 @@ public function load() { 'bid' => '8', )) ->execute(); - $this->database->insert('menu_links')->fields(array( + $dbWrapper->getDbConnection()->insert('menu_links')->fields(array( 'menu_name', 'mlid', 'plid', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6BookSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6BookSettings.php index 0bf6a57..5be62d9 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6BookSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6BookSettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing book.settings.yml migration. */ -class Drupal6BookSettings extends Drupal6DumpBase { +class Drupal6BookSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php index d042f72..12d6662 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php @@ -7,13 +7,15 @@ namespace Drupal\migrate_drupal\Tests\Dump; -class Drupal6Box extends Drupal6DumpBase { +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + +class Drupal6Box implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('boxes', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('boxes', array( 'description' => 'Stores contents of custom-made blocks.', 'fields' => array( 'bid' => array( @@ -47,7 +49,7 @@ public function load() { 'primary key' => array('bid'), )); - $this->database->insert('boxes')->fields(array( + $dbWrapper->getDbConnection()->insert('boxes')->fields(array( 'bid', 'body', 'info', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php index 0a938a0..ac0da78 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php @@ -7,13 +7,15 @@ namespace Drupal\migrate_drupal\Tests\Dump; -class Drupal6Comment extends Drupal6DumpBase { +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + +class Drupal6Comment implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('comments', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('comments', array( 'description' => 'Stores comments and associated data.', 'fields' => array( 'cid' => array( @@ -113,7 +115,7 @@ public function load() { ), 'primary key' => array('cid'), )); - $this->database->insert('comments')->fields(array( + $dbWrapper->getDbConnection()->insert('comments')->fields(array( 'cid', 'pid', 'nid', @@ -183,7 +185,7 @@ public function load() { 'homepage' => 'http://drupal.org', )) ->execute(); - $this->setModuleVersion('comment', '6001'); + $dbWrapper->setModuleVersion('comment', '6001'); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php index 9d150f2..cc627eb 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php @@ -6,18 +6,21 @@ */ namespace Drupal\migrate_drupal\Tests\Dump; + +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing comment variables migration. */ -class Drupal6CommentVariable extends Drupal6DumpBase { +class Drupal6CommentVariable implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->createTable('node_type', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->createTable('node_type', array( 'fields' => array( 'type' => array( 'type' => 'varchar', @@ -106,7 +109,7 @@ public function load() { 'module' => 'node', 'name' => 'node_type', )); - $this->database->insert('node_type')->fields(array( + $dbWrapper->getDbConnection()->insert('node_type')->fields(array( 'type', 'name', 'module', @@ -155,7 +158,7 @@ public function load() { 'orig_type' => 'story', )) ->execute(); - $this->database->insert('variable')->fields(array( + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) @@ -232,7 +235,7 @@ public function load() { 'value' => 's:1:"0";', )) ->execute(); - $this->setModuleVersion('comment', '6001'); + $dbWrapper->setModuleVersion('comment', '6001'); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php index 541b6d2..b2d1895 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php @@ -6,16 +6,19 @@ */ namespace Drupal\migrate_drupal\Tests\Dump; + +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing contact category migration. */ -class Drupal6ContactCategory extends Drupal6DumpBase { +class Drupal6ContactCategory implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('contact', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('contact', array( 'description' => 'Contact form category settings.', 'fields' => array( 'cid' => array( @@ -66,7 +69,7 @@ public function load() { 'list' => array('weight', 'category'), ), )); - $this->database->insert('contact')->fields(array('cid', 'category', 'recipients', 'reply', 'weight', 'selected')) + $dbWrapper->getDbConnection()->insert('contact')->fields(array('cid', 'category', 'recipients', 'reply', 'weight', 'selected')) ->values(array( 'cid' => '1', 'category' => 'Website feedback', @@ -76,6 +79,6 @@ public function load() { 'selected' => '1', )) ->execute(); - $this->setModuleVersion('contact', '6001'); + $dbWrapper->setModuleVersion('contact', '6001'); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactSettings.php index 56fddf5..3e75bcb 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactSettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing contact.settings.yml migration. */ -class Drupal6ContactSettings extends Drupal6DumpBase { +class Drupal6ContactSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php index c126fee..fc0c6f0 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php @@ -2,17 +2,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing date formats migration. */ -class Drupal6DateFormat extends Drupal6DumpBase { +class Drupal6DateFormat implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DblogSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DblogSettings.php index 2b04e9b..1f4c3e3 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DblogSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DblogSettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing dblog.settings.yml migration. */ -class Drupal6DblogSettings extends Drupal6DumpBase { +class Drupal6DblogSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php index 9753a38..7df5867 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php @@ -7,16 +7,18 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing entity display migration. */ -class Drupal6FieldInstance extends Drupal6DumpBase { +class Drupal6FieldInstance implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('content_node_field_instance', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('content_node_field_instance', array( 'description' => 'Table that contains field instance settings.', 'fields' => array( 'field_name' => array( @@ -81,7 +83,7 @@ public function load() { 'primary key' => array('field_name', 'type_name'), )); - $this->database->insert('content_node_field_instance')->fields(array( + $dbWrapper->getDbConnection()->insert('content_node_field_instance')->fields(array( 'field_name', 'type_name', 'weight', @@ -589,7 +591,7 @@ public function load() { ->execute(); // Create the field table. - $this->createTable('content_node_field', array( + $dbWrapper->createTable('content_node_field', array( 'description' => 'Table that contains field instance settings.', 'fields' => array( 'field_name' => array( @@ -656,7 +658,7 @@ public function load() { 'primary key' => array('field_name'), )); - $this->database->insert('content_node_field')->fields(array( + $dbWrapper->getDbConnection()->insert('content_node_field')->fields(array( 'field_name', 'module', 'type', @@ -786,7 +788,7 @@ public function load() { )) ->execute(); - $this->createTable('content_field_test_two', array( + $dbWrapper->createTable('content_field_test_two', array( 'description' => 'Table for field_test_two', 'fields' => array( 'vid' => array( @@ -824,7 +826,7 @@ public function load() { ), 'primary key' => array('vid', 'delta'), )); - $this->database->insert('content_field_test_two')->fields(array( + $dbWrapper->getDbConnection()->insert('content_field_test_two')->fields(array( 'vid', 'nid', 'field_test_two_value', @@ -846,7 +848,7 @@ public function load() { 'field_test_two_format' => 1, )) ->execute(); - $this->setModuleVersion('content', '6001'); + $dbWrapper->setModuleVersion('content', '6001'); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldSettings.php index 44e899f..d59a1b7 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldSettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing field.settings.yml migration. */ -class Drupal6FieldSettings extends Drupal6DumpBase { +class Drupal6FieldSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php index 23f0dc6..ee97f38 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing file migrations. */ -class Drupal6File extends Drupal6DumpBase { +class Drupal6File implements DumpInterface { /** * {@inheritdoc} */ - public function load() { + public function load(Drupal6DbWrapper $dbWrapper) { - $this->createTable('files', array( + $dbWrapper->createTable('files', array( 'fields' => array( 'fid' => array( 'type' => 'serial', @@ -83,7 +85,7 @@ public function load() { 'module' => 'system', 'name' => 'files', )); - $this->database->insert('files')->fields(array( + $dbWrapper->getDbConnection()->insert('files')->fields(array( 'fid', 'uid', 'filename', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FileSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FileSettings.php index b00c541..592f61c 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FileSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FileSettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing file.settings.yml migration. */ -class Drupal6FileSettings extends Drupal6DumpBase { +class Drupal6FileSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FilterFormat.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FilterFormat.php index edfa35a..07da430 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FilterFormat.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FilterFormat.php @@ -6,17 +6,20 @@ */ namespace Drupal\migrate_drupal\Tests\Dump; + +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing filter format migration. */ -class Drupal6FilterFormat extends Drupal6DumpBase { +class Drupal6FilterFormat implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('filters', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('filters', array( 'description' => 'Table that maps filters (HTML corrector) to input formats (Filtered HTML).', 'fields' => array( 'fid' => array( @@ -60,7 +63,7 @@ public function load() { 'list' => array('format', 'weight', 'module', 'delta'), ), )); - $this->createTable('filter_formats', array( + $dbWrapper->createTable('filter_formats', array( 'description' => 'Stores input formats: custom groupings of filters, such as Filtered HTML.', 'fields' => array( 'format' => array( @@ -94,8 +97,8 @@ public function load() { 'primary key' => array('format'), 'unique keys' => array('name' => array('name')), )); - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) @@ -116,7 +119,7 @@ public function load() { 'value' => 's:2:"72";', )) ->execute(); - $this->database->insert('filter_formats')->fields(array( + $dbWrapper->getDbConnection()->insert('filter_formats')->fields(array( 'format', 'name', 'roles', @@ -142,7 +145,7 @@ public function load() { )) ->execute(); - $this->database->insert('filters')->fields(array( + $dbWrapper->getDbConnection()->insert('filters')->fields(array( 'fid', 'format', 'module', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ForumSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ForumSettings.php index 8ae739e..6f5a435 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ForumSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ForumSettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing forum.site.yml migration. */ -class Drupal6ForumSettings extends Drupal6DumpBase { +class Drupal6ForumSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6LocaleSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6LocaleSettings.php index 7dc6e5c..8d4c3c3 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6LocaleSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6LocaleSettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing locale.settings.yml migration. */ -class Drupal6LocaleSettings extends Drupal6DumpBase { +class Drupal6LocaleSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php index 01ef84d..9ff52a1 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php @@ -5,16 +5,19 @@ */ namespace Drupal\migrate_drupal\Tests\Dump; + +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing menu migration. */ -class Drupal6Menu extends Drupal6DumpBase { +class Drupal6Menu implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('menu_custom', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('menu_custom', array( 'fields' => array( 'menu_name' => array( 'type' => 'varchar', @@ -39,7 +42,7 @@ public function load() { 'module' => 'menu', 'name' => 'menu_custom', )); - $this->database->insert('menu_custom')->fields(array('menu_name', 'title', 'description')) + $dbWrapper->getDbConnection()->insert('menu_custom')->fields(array('menu_name', 'title', 'description')) ->values(array( 'menu_name' => 'navigation', 'title' => 'Navigation', @@ -56,7 +59,7 @@ public function load() { 'description' => 'Secondary links are often used for pages like legal notices, contact details, and other secondary navigation items that play a lesser role than primary links', )) ->execute(); - $this->setModuleVersion('menu', '6001'); + $dbWrapper->setModuleVersion('menu', '6001'); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6MenuSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6MenuSettings.php index 752614a..bc02cc6 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6MenuSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6MenuSettings.php @@ -7,18 +7,20 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing menu_ui.settings.yml migration. */ -class Drupal6MenuSettings extends Drupal6DumpBase { +class Drupal6MenuSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->setModuleVersion('menu', 6000); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->setModuleVersion('menu', 6000); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php index cd31852..ab1bc78 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php @@ -7,16 +7,18 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing the node migration. */ -class Drupal6Node extends Drupal6DumpBase { +class Drupal6Node implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('node', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('node', array( 'description' => 'The base table for nodes.', 'fields' => array( 'nid' => array( @@ -132,7 +134,7 @@ public function load() { ), 'primary key' => array('nid'), )); - $this->database->insert('node')->fields(array( + $dbWrapper->getDbConnection()->insert('node')->fields(array( 'nid', 'vid', 'type', @@ -184,7 +186,7 @@ public function load() { 'translate' => 0, )) ->execute(); - $this->createTable('node_revisions', array( + $dbWrapper->createTable('node_revisions', array( 'description' => 'Stores information about each saved version of a {node}.', 'fields' => array( 'nid' => array( @@ -251,7 +253,7 @@ public function load() { 'primary key' => array('vid'), )); - $this->database->insert('node_revisions')->fields( + $dbWrapper->getDbConnection()->insert('node_revisions')->fields( array( 'nid', 'vid', @@ -287,7 +289,7 @@ public function load() { )) ->execute(); - $this->createTable('content_type_story', array( + $dbWrapper->createTable('content_type_story', array( 'description' => 'The content type join table.', 'fields' => array( 'nid' => array( @@ -314,7 +316,7 @@ public function load() { 'primary key' => array('vid'), )); - $this->database->insert('content_type_story')->fields( + $dbWrapper->getDbConnection()->insert('content_type_story')->fields( array( 'nid', 'vid', @@ -326,6 +328,6 @@ public function load() { 'field_test_value' => 'This is a text field', )) ->execute(); - $this->setModuleVersion('content', 6001); + $dbWrapper->setModuleVersion('content', 6001); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php index 8ec82b5..d32340a 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php @@ -7,18 +7,20 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing field.instance.node.*.body.yml migration. */ -class Drupal6NodeBodyInstance extends Drupal6DumpBase { +class Drupal6NodeBodyInstance implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->createTable('node_type'); - $this->database->insert('node_type')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->createTable('node_type'); + $dbWrapper->getDbConnection()->insert('node_type')->fields(array( 'type', 'name', 'module', @@ -83,7 +85,7 @@ public function load() { 'orig_type' => '', )) ->execute(); - $this->database->insert('variable')->fields(array( + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeRevision.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeRevision.php index 04a4ad5..abb7d7a 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeRevision.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeRevision.php @@ -8,13 +8,15 @@ namespace Drupal\migrate_drupal\Tests\Dump; -class Drupal6NodeRevision extends Drupal6DumpBase { +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + +class Drupal6NodeRevision implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->database->insert('node_revisions')->fields( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->getDbConnection()->insert('node_revisions')->fields( array( 'nid', 'vid', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeSettings.php index 4fb67b9..ebd401a 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeSettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing node.settings.yml migration. */ -class Drupal6NodeSettings extends Drupal6DumpBase { +class Drupal6NodeSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php index 87db257..49c4521 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php @@ -6,17 +6,20 @@ */ namespace Drupal\migrate_drupal\Tests\Dump; + +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing node type migration. */ -class Drupal6NodeType extends Drupal6DumpBase { +class Drupal6NodeType implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('node_type'); - $this->database->insert('node_type')->fields( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('node_type'); + $dbWrapper->getDbConnection()->insert('node_type')->fields( array( 'type', 'name', @@ -67,7 +70,7 @@ public function load() { )) ->execute(); - $this->database->merge('node_type') + $dbWrapper->getDbConnection()->merge('node_type') ->key(array('type' => 'story')) ->fields(array( 'name' => 'Story', @@ -86,8 +89,8 @@ public function load() { )) ->execute(); - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php index c0c7298..d520e97 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php @@ -6,18 +6,21 @@ */ namespace Drupal\migrate_drupal\Tests\Dump; + +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing search page migration. */ -class Drupal6SearchPage extends Drupal6DumpBase { +class Drupal6SearchPage implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchSettings.php index e6c8ea0..1ba5511 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchSettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing forum.site.yml migration. */ -class Drupal6SearchSettings extends Drupal6DumpBase { +class Drupal6SearchSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SimpletestSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SimpletestSettings.php index 4469f8d..bb6100f 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SimpletestSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SimpletestSettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing simpletest.settings.yml migration. */ -class Drupal6SimpletestSettings extends Drupal6DumpBase { +class Drupal6SimpletestSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6StatisticsSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6StatisticsSettings.php index 071b44a..78c2909 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6StatisticsSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6StatisticsSettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing statistics.settings.yml migration. */ -class Drupal6StatisticsSettings extends Drupal6DumpBase { +class Drupal6StatisticsSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SyslogSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SyslogSettings.php index 4155820..c50b3be 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SyslogSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SyslogSettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing syslog.settings.yml migration. */ -class Drupal6SyslogSettings extends Drupal6DumpBase { +class Drupal6SyslogSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php index 44ee90b..e9414d5 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing system.cron.yml migration. */ -class Drupal6SystemCron extends Drupal6DumpBase { +class Drupal6SystemCron implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFile.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFile.php index a3937a1..8ca7cbb 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFile.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFile.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing system.file.yml migration. */ -class Drupal6SystemFile extends Drupal6DumpBase { +class Drupal6SystemFile implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) @@ -33,20 +35,4 @@ public function load() { ->execute(); } - /** - * Dump for the standalone test in MigrateFileTest. - */ - public function loadMigrateFileStandalone() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( - 'name', - 'value', - )) - ->values(array( - 'name' => 'file_directory_path', - 'value' => 's:10:"files/test";', - )) - ->execute(); - } - } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFileStandalone.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFileStandalone.php new file mode 100644 index 0000000..b0432c3 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFileStandalone.php @@ -0,0 +1,37 @@ +createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( + 'name', + 'value', + )) + ->values(array( + 'name' => 'file_directory_path', + 'value' => 's:10:"files/test";', + )) + ->execute(); + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFilter.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFilter.php index fe34217..7631aa0 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFilter.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFilter.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing system.filter.yml migration. */ -class Drupal6SystemFilter extends Drupal6DumpBase { +class Drupal6SystemFilter implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImage.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImage.php index a5f0be9..5453eca 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImage.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImage.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing system.image.yml migration. */ -class Drupal6SystemImage extends Drupal6DumpBase { +class Drupal6SystemImage implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImageGd.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImageGd.php index f5798f1..72a7d37 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImageGd.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImageGd.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing system.image.gd.yml migration. */ -class Drupal6SystemImageGd extends Drupal6DumpBase { +class Drupal6SystemImageGd implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemMaintenance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemMaintenance.php index e98b741..7a1b1f8 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemMaintenance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemMaintenance.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing system.maintenance.yml migration. */ -class Drupal6SystemMaintenance extends Drupal6DumpBase { +class Drupal6SystemMaintenance implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php index b8bbf63..5c91e7c 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing system.performance.yml migration. */ -class Drupal6SystemPerformance extends Drupal6DumpBase { +class Drupal6SystemPerformance implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php index ecf7488..87181d5 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing system.settings.yml migration. */ -class Drupal6SystemRss extends Drupal6DumpBase { +class Drupal6SystemRss implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php index e6ebe16..bdb32a9 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing system.site.yml migration. */ -class Drupal6SystemSite extends Drupal6DumpBase { +class Drupal6SystemSite implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemTheme.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemTheme.php index 9b9ceb3..7dac9a7 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemTheme.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemTheme.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing system.theme.yml migration. */ -class Drupal6SystemTheme extends Drupal6DumpBase { +class Drupal6SystemTheme implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomySettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomySettings.php index 25f45c0..aa83bd1 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomySettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomySettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing taxonomy.settings.yml migration. */ -class Drupal6TaxonomySettings extends Drupal6DumpBase { +class Drupal6TaxonomySettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php index 2f96140..1d807af 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php @@ -5,18 +5,21 @@ */ namespace Drupal\migrate_drupal\Tests\Dump; + +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing taxonomy term migration. */ -class Drupal6TaxonomyTerm extends Drupal6DumpBase { +class Drupal6TaxonomyTerm implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->setModuleVersion('taxonomy', 6000); + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->setModuleVersion('taxonomy', 6000); - $this->createTable('term_data', array( + $dbWrapper->createTable('term_data', array( 'fields' => array( 'tid' => array( 'type' => 'serial', @@ -65,7 +68,7 @@ public function load() { 'name' => 'term_data', )); - $this->createTable('term_hierarchy', array( + $dbWrapper->createTable('term_hierarchy', array( 'fields' => array( 'tid' => array( 'type' => 'int', @@ -93,7 +96,7 @@ public function load() { 'name' => 'term_hierarchy', )); - $this->database->insert('term_data')->fields(array( + $dbWrapper->getDbConnection()->insert('term_data')->fields(array( 'tid', 'vid', 'name', @@ -144,7 +147,7 @@ public function load() { )) ->execute(); - $this->database->insert('term_hierarchy')->fields(array( + $dbWrapper->getDbConnection()->insert('term_hierarchy')->fields(array( 'tid', 'parent', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php index 70b2429..150404d 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php @@ -6,16 +6,19 @@ */ namespace Drupal\migrate_drupal\Tests\Dump; + +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing taxonomy vocabulary migration. */ -class Drupal6TaxonomyVocabulary extends Drupal6DumpBase { +class Drupal6TaxonomyVocabulary implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('vocabulary', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('vocabulary', array( 'description' => 'Stores vocabulary information.', 'fields' => array( 'vid' => array( @@ -104,7 +107,7 @@ public function load() { 'list' => array('weight', 'name'), ), )); - $this->createTable('vocabulary_node_types', array( + $dbWrapper->createTable('vocabulary_node_types', array( 'description' => 'Stores which node types vocabularies may be used with.', 'fields' => array( 'vid' => array( @@ -127,7 +130,7 @@ public function load() { 'vid' => array('vid'), ), )); - $this->database->insert('vocabulary')->fields(array( + $dbWrapper->getDbConnection()->insert('vocabulary')->fields(array( 'vid', 'name', 'description', @@ -180,7 +183,7 @@ public function load() { 'weight' => '6', )) ->execute(); - $this->setModuleVersion('taxonomy', 6001); + $dbWrapper->setModuleVersion('taxonomy', 6001); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php index 8df32d7..96581ff 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php @@ -9,14 +9,16 @@ namespace Drupal\migrate_drupal\Tests\Dump; -class Drupal6TermNode extends Drupal6DumpBase { +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + +class Drupal6TermNode implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->setModuleVersion('taxonomy', 6000); - $this->createTable('term_node', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->setModuleVersion('taxonomy', 6000); + $dbWrapper->createTable('term_node', array( 'fields' => array( 'nid' => array( 'type' => 'int', @@ -52,7 +54,7 @@ public function load() { 'module' => 'taxonomy', 'name' => 'term_node', )); - $this->database->insert('term_node')->fields(array( + $dbWrapper->getDbConnection()->insert('term_node')->fields(array( 'nid', 'vid', 'tid', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TextSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TextSettings.php index 59c7680..9b4029b 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TextSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TextSettings.php @@ -7,18 +7,20 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing text.settings.yml migration. */ -class Drupal6TextSettings extends Drupal6DumpBase { +class Drupal6TextSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); // This needs to be a merge to avoid conflicts with Drupal6NodeBodyInstance. - $this->database->merge('variable') + $dbWrapper->getDbConnection()->merge('variable') ->key(array('name' => 'teaser_length')) ->fields(array('value' => 'i:456;')) ->execute(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UpdateSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UpdateSettings.php index 638b618..57a6ee0 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UpdateSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UpdateSettings.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing update.settings.yml migration. */ -class Drupal6UpdateSettings extends Drupal6DumpBase { +class Drupal6UpdateSettings implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php index 6fd53d3..cbf2deb 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php @@ -7,14 +7,16 @@ namespace Drupal\migrate_drupal\Tests\Dump; -class Drupal6Upload extends Drupal6DumpBase { +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + +class Drupal6Upload implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->setModuleVersion('upload', 6000); - $this->createTable('upload', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->setModuleVersion('upload', 6000); + $dbWrapper->createTable('upload', array( 'fields' => array( 'fid' => array( 'type' => 'int', @@ -66,7 +68,7 @@ public function load() { 'nid' => array('nid'), ), )); - $this->database->insert('upload')->fields(array( + $dbWrapper->getDbConnection()->insert('upload')->fields(array( 'nid', 'vid', 'fid', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadField.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadField.php index 6df410d..2cb7084 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadField.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadField.php @@ -7,13 +7,15 @@ namespace Drupal\migrate_drupal\Tests\Dump; -class Drupal6UploadField extends Drupal6DumpBase { +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + +class Drupal6UploadField implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->setModuleVersion('upload', 6000); + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->setModuleVersion('upload', 6000); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php index c3721ba..2aa4170 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php @@ -7,18 +7,20 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing the upload migration. */ -class Drupal6UploadInstance extends Drupal6DumpBase { +class Drupal6UploadInstance implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->setModuleVersion('upload', 6000); - $this->createTable('node_type'); - $this->database->merge('node_type') + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->setModuleVersion('upload', 6000); + $dbWrapper->createTable('node_type'); + $dbWrapper->getDbConnection()->merge('node_type') ->key(array('type' => 'page')) ->fields(array( 'name' => 'Page', @@ -36,7 +38,7 @@ public function load() { 'orig_type' => 'page', )) ->execute(); - $this->database->merge('node_type') + $dbWrapper->getDbConnection()->merge('node_type') ->key(array('type' => 'story')) ->fields(array( 'name' => 'Story', @@ -54,7 +56,7 @@ public function load() { 'orig_type' => 'story', )) ->execute(); - $this->database->merge('node_type') + $dbWrapper->getDbConnection()->merge('node_type') ->key(array('type' => 'article')) ->fields(array( 'name' => 'Article', @@ -72,8 +74,8 @@ public function load() { 'orig_type' => 'story', )) ->execute(); - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php index 2af66ef..9d71e3a 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php @@ -6,16 +6,18 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing url alias migrations. */ -class Drupal6UrlAlias extends Drupal6DumpBase { +class Drupal6UrlAlias implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('url_alias', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('url_alias', array( 'description' => 'A list of URL aliases for Drupal paths; a user may visit either the source or destination path.', 'fields' => array( 'pid' => array( @@ -57,7 +59,7 @@ public function load() { 'indexes' => array('src_language_pid' => array('src', 'language', 'pid')), )); - $this->database->insert('url_alias')->fields(array( + $dbWrapper->getDbConnection()->insert('url_alias')->fields(array( 'pid', 'src', 'dst', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php index 2b662e8..4561e7e 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php @@ -7,24 +7,26 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing the users migration. */ -class Drupal6User extends Drupal6DumpBase { +class Drupal6User implements DumpInterface { /** * {@inheritdoc} */ - public function load() { + public function load(Drupal6DbWrapper $dbWrapper) { foreach (static::getSchema() as $table => $schema) { // Create tables. - $this->createTable($table, $schema); + $dbWrapper->createTable($table, $schema); // Insert data. $data = static::getData($table); if ($data) { - $query = $this->database->insert($table)->fields(array_keys($data[0])); + $query = $dbWrapper->getDbConnection()->insert($table)->fields(array_keys($data[0])); foreach ($data as $record) { $query->values($record); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserMail.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserMail.php index 114b482..55bba9c 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserMail.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserMail.php @@ -7,17 +7,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing user.mail.yml migration. */ -class Drupal6UserMail extends Drupal6DumpBase { +class Drupal6UserMail implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('variable'); - $this->database->insert('variable')->fields(array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('variable'); + $dbWrapper->getDbConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php index 3d3d017..1061a21 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php @@ -7,16 +7,18 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing profile fields. */ -class Drupal6UserProfileFields extends Drupal6DumpBase { +class Drupal6UserProfileFields implements DumpInterface { /** * {@inheritdoc} */ - public function load() { - $this->createTable('profile_fields', array( + public function load(Drupal6DbWrapper $dbWrapper) { + $dbWrapper->createTable('profile_fields', array( 'fields' => array( 'fid' => array( 'type' => 'serial', @@ -107,13 +109,13 @@ public function load() { // Insert data. $data = static::getData('profile_fields'); if ($data) { - $query = $this->database->insert('profile_fields')->fields(array_keys($data[0])); + $query = $dbWrapper->getDbConnection()->insert('profile_fields')->fields(array_keys($data[0])); foreach ($data as $record) { $query->values($record); } $query->execute(); } - $this->setModuleVersion('profile', 6001); + $dbWrapper->setModuleVersion('profile', 6001); } /** diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserRole.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserRole.php index 4c91ed9..5474dc6 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserRole.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserRole.php @@ -7,23 +7,25 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing user role migration. */ -class Drupal6UserRole extends Drupal6DumpBase { +class Drupal6UserRole implements DumpInterface { /** * {@inheritdoc} */ - public function load() { + public function load(Drupal6DbWrapper $dbWrapper) { foreach (static::getSchema() as $table => $schema) { // Create tables. - $this->createTable($table, $schema); + $dbWrapper->createTable($table, $schema); // Insert data. $data = static::getData($table); if ($data) { - $query = $this->database->insert($table)->fields(array_keys($data[0])); + $query = $dbWrapper->getDbConnection()->insert($table)->fields(array_keys($data[0])); foreach ($data as $record) { $query->values($record); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php index 1330cb5..9764d80 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php @@ -6,17 +6,19 @@ namespace Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\d6\Drupal6DbWrapper; + /** * Database dump for testing vocabulary to field migration. */ -class Drupal6VocabularyField extends Drupal6DumpBase { +class Drupal6VocabularyField implements DumpInterface { /** * {@inheritdoc} */ - public function load() { + public function load(Drupal6DbWrapper $dbWrapper) { - $this->createTable('vocabulary', array( + $dbWrapper->createTable('vocabulary', array( 'fields' => array( 'vid' => array( 'type' => 'serial', @@ -101,7 +103,7 @@ public function load() { 'name' => 'vocabulary', )); - $this->database->insert('vocabulary') + $dbWrapper->getDbConnection()->insert('vocabulary') ->fields(array( 'vid' => 4, 'name' => 'Tags', @@ -118,7 +120,7 @@ public function load() { ->execute(); - $this->createTable('vocabulary_node_types', array( + $dbWrapper->createTable('vocabulary_node_types', array( 'description' => 'Stores which node types vocabularies may be used with.', 'fields' => array( 'vid' => array( @@ -142,7 +144,7 @@ public function load() { ), )); - $this->database->insert('vocabulary_node_types')->fields(array( + $dbWrapper->getDbConnection()->insert('vocabulary_node_types')->fields(array( 'vid', 'type', )) @@ -167,7 +169,7 @@ public function load() { 'type' => 'page', )) ->execute(); - $this->setModuleVersion('taxonomy', 6001); + $dbWrapper->setModuleVersion('taxonomy', 6001); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/DumpInterface.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/DumpInterface.php new file mode 100644 index 0000000..b24ea7b --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/DumpInterface.php @@ -0,0 +1,20 @@ +drupal6DbWrapper = new Drupal6DbWrapper($drupal6Database); + } + + /** + * Loads a dump into the Drupal 6 database. + * + * @param DumpInterface $dump + */ + protected function loadDrupal6Dump(DumpInterface $dump) { + $dump->load($this->drupal6DbWrapper); + } + + /** + * Loads a number of dumps into the Drupal 6 database. + * + * @param DumpInterface[] $dumps + */ + protected function loadDrupal6Dumps($dumps) { + foreach ($dumps as $dump) { + $dump->load($this->drupal6DbWrapper); + } + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/MigrateDrupalTestBase.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/MigrateDrupalTestBase.php index f660102..3b699de 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/MigrateDrupalTestBase.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/MigrateDrupalTestBase.php @@ -9,23 +9,16 @@ use Drupal\migrate\Tests\MigrateTestBase; +/** + * Base test class for migrations from Drupal 6 or Drupal 7. + */ class MigrateDrupalTestBase extends MigrateTestBase { /** * Modules to enable. * - * @var array + * @var string[] */ public static $modules = array('migrate_drupal'); - /** - * Returns the path to the dump directory. - * - * @return string - * A string that represents the dump directory path. - */ - protected function getDumpDirectory() { - return __DIR__ . '/Dump'; - } - } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DumpBase.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php similarity index 83% rename from core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DumpBase.php rename to core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php index c340f4c..cd47790 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DumpBase.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php @@ -5,49 +5,90 @@ * Contains \Drupal\migrate_drupal\Tests\Dump\Drupal6DumpBase. */ -namespace Drupal\migrate_drupal\Tests\Dump; +namespace Drupal\migrate_drupal\Tests\d6; use Drupal\Core\Database\Connection; /** - * Base class for the dump classes. + * Wrapper for a (temporary) Drupal 6 database. */ -class Drupal6DumpBase { +class Drupal6DbWrapper { /** - * The database connection. + * The database connection for the Drupal 6 database. * * @var \Drupal\Core\Database\Connection */ protected $database; /** + * An array to keep track of tables already created. + * + * @var true[] + */ + protected $migrateTables; + + /** * Sample database schema and values. * * @param \Drupal\Core\Database\Connection $database - * The database connection. + * The database connection for the Drupal 6 database. */ public function __construct(Connection $database) { $this->database = $database; } /** - * Create a new table from a Drupal table definition if it doesn't exist. + * Returns the Drupal 6 database connection. + * + * @return \Drupal\Core\Database\Connection + * The database connection for the Drupal 6 database. + */ + public function getDbConnection() { + return $this->database; + } + + /** + * Creates a new table from a Drupal table definition if it doesn't exist. * - * @param $name + * @param string $name * The name of the table to create. - * @param $table - * A Schema API table definition array. + * @param array|null $table + * A Schema API table definition array, or + * NULL, for a table with a known schema. + * + * @throws \Exception */ - protected function createTable($name, $table = NULL) { - // This must be on the database connection to be shared among classes. - if (empty($this->database->migrateTables[$name])) { - $this->database->migrateTables[$name] = TRUE; - $this->database->schema()->createTable($name, $table ?: $this->tableDefinitions()[$name]); + public function createTable($name, $table = NULL) { + if (!empty($this->migrateTables[$name])) { + return; + } + if (NULL === $table) { + $table = $this->getTableDefinition($name); } + $this->migrateTables[$name] = TRUE; + $this->database->schema()->createTable($name, $table); + } + + /** + * @param string $name + * The name of the table to create. This must be one of the "known" table + * names, see tableDefinitions() below. + * + * @throws \Exception + * @return array + */ + protected function getTableDefinition($name) { + $knownDefinitions = $this->tableDefinitions(); + if (!isset($knownDefinitions[$name])) { + throw new \Exception("Unknown table name '$name'."); + } + return $knownDefinitions[$name]; } /** * Table definitions. + * + * @return array[] */ protected function tableDefinitions() { return array( @@ -232,8 +273,8 @@ protected function tableDefinitions() { /** * Sets a module version and status. * - * @param $module - * @param $version + * @param string $module + * @param string $version * @param int $status */ public function setModuleVersion($module, $version, $status = 1) { diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateActionConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateActionConfigsTest.php index b3e36dd..7f16a65 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateActionConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateActionConfigsTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6ActionSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables from the Action module. */ -class MigrateActionConfigsTest extends MigrateDrupalTestBase { +class MigrateActionConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -38,11 +39,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_action_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6ActionSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6ActionSettings()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorConfigsTest.php index 2cb114a..18359f8 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorConfigsTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6AggregatorSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables from the Aggregator module. */ -class MigrateAggregatorConfigsTest extends MigrateDrupalTestBase { +class MigrateAggregatorConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -38,11 +39,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_aggregator_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6AggregatorSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6AggregatorSettings()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorFeedTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorFeedTest.php index 191bc38..5d6bb0c 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorFeedTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorFeedTest.php @@ -10,9 +10,10 @@ use Drupal\aggregator\Entity\Feed; use Drupal\Core\Language\Language; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6AggregatorFeed; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; -class MigrateAggregatorFeedTest extends MigrateDrupalTestBase { +class MigrateAggregatorFeedTest extends MigrateDrupal6TestBase { static $modules = array('aggregator'); @@ -32,11 +33,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_aggregator_feed'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6AggregatorFeed.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6AggregatorFeed()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorItemTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorItemTest.php index c5ca816..e61a706 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorItemTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorItemTest.php @@ -10,12 +10,13 @@ use Drupal\aggregator\Entity\Item; use Drupal\Core\Language\Language; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6AggregatorItem; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Test Drupal 6 aggregator item migration to Drupal 8. */ -class MigrateAggregatorItemTest extends MigrateDrupalTestBase { +class MigrateAggregatorItemTest extends MigrateDrupal6TestBase { static $modules = array('aggregator'); @@ -55,10 +56,7 @@ public function setUp() { $entity->save(); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_aggregator_item'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6AggregatorItem.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6AggregatorItem()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateBlockTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateBlockTest.php index 3e617f4..bcda1b3 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateBlockTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateBlockTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6Block; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Test the block settings migration. */ -class MigrateBlockTest extends MigrateDrupalTestBase { +class MigrateBlockTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -57,10 +58,7 @@ public function setUp() { $this->prepareIdMappings(array('d6_custom_block' => array(array(array(1), array(1))))); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_block'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6Block.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6Block()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateBookConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateBookConfigsTest.php index 6f2e179..a07a3f3 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateBookConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateBookConfigsTest.php @@ -9,12 +9,13 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6BookSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables from the Book module. */ -class MigrateBookConfigsTest extends MigrateDrupalTestBase { +class MigrateBookConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -39,11 +40,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_book_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6BookSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6BookSettings()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateBookTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateBookTest.php index d29ad95..f475a64 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateBookTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateBookTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6Book; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 book structure to Drupal 8 migration. */ -class MigrateBookTest extends MigrateDrupalTestBase { +class MigrateBookTest extends MigrateDrupal6TestBase { public static $modules = array('book'); @@ -45,11 +46,9 @@ protected function setUp() { } $this->prepareIdMappings($id_mappings); // Load database dumps to provide source data. - $dumps = array( - $this->getDumpDirectory() . '/Drupal6Book.php', - ); - $this->loadDumps($dumps); + $this->loadDrupal6Dump(new Drupal6Book()); // Migrate books.. + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_book'); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCckFieldRevisionTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCckFieldRevisionTest.php index 2c4ec30..4556fc7 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCckFieldRevisionTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCckFieldRevisionTest.php @@ -8,6 +8,7 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; +use Drupal\migrate_drupal\Tests\Dump\Drupal6NodeRevision; /** * Test cck field revision migration from Drupal 6 to 8. @@ -73,10 +74,7 @@ protected function setUp() { ), ); $this->prepareIdMappings($id_mappings); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6NodeRevision.php', - ); - $this->loadDumps($dumps); + $this->loadDrupal6Dump(new Drupal6NodeRevision()); $migrations = entity_load_multiple('migration', array('d6_cck_field_revision:*')); foreach ($migrations as $migration) { diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentTest.php index 409f6d2..6afeb40 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentTest.php @@ -10,12 +10,14 @@ use Drupal\comment\Entity\Comment; use Drupal\Core\Language\Language; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; + +use Drupal\migrate_drupal\Tests\Dump\Drupal6Comment; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 to Drupal 6 comment migration. */ -class MigrateCommentTest extends MigrateDrupalTestBase { +class MigrateCommentTest extends MigrateDrupal6TestBase { static $modules = array('node', 'comment'); @@ -55,11 +57,7 @@ public function setUp() { \Drupal::service('comment.manager')->addDefaultField('node', 'page'); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_comment'); - - $dumps = array( - $this->getDumpDirectory() . '/Drupal6Comment.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6Comment()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentVariableDisplayBase.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentVariableDisplayBase.php index ac5c9c7..59b0342 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentVariableDisplayBase.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentVariableDisplayBase.php @@ -8,12 +8,14 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6CommentVariable; + +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Base class for Drupal 6 comment variables to Drupal 8 entity display tests. */ -abstract class MigrateCommentVariableDisplayBase extends MigrateDrupalTestBase { +abstract class MigrateCommentVariableDisplayBase extends MigrateDrupal6TestBase { /** * The ID of migration to run. @@ -31,13 +33,6 @@ static $modules = array('comment', 'node'); /** - * The database dumps used. - * - * @var array - */ - protected $dumps; - - /** * The node types being tested. * * @var array @@ -66,9 +61,6 @@ protected function setUp() { 'required' => 1, ))->save(); } - $this->dumps = array( - $this->getDumpDirectory() . '/Drupal6CommentVariable.php', - ); $id_mappings = array( 'd6_comment_field_instance' => array( array(array('page'), array('node', 'comment', 'page')), @@ -77,10 +69,9 @@ protected function setUp() { $this->prepareIdMappings($id_mappings); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', static::MIGRATION); - $this->prepare($migration, $this->dumps); + $this->loadDrupal6Dump(new Drupal6Commentvariable()); $executable = new MigrateExecutable($migration, $this); $executable->import(); - } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentVariableField.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentVariableField.php index c5c88c4..3c7c4db 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentVariableField.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentVariableField.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6CommentVariable; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests comment variables migrated into a field entity. */ -class MigrateCommentVariableField extends MigrateDrupalTestBase { +class MigrateCommentVariableField extends MigrateDrupal6TestBase { static $modules = array('comment', 'node'); @@ -38,10 +39,7 @@ public function setUp() { } /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_comment_field'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6CommentVariable.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6CommentVariable()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentVariableInstance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentVariableInstance.php index 60e9b57..8f8c838 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentVariableInstance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentVariableInstance.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6CommentVariable; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests comment variables migrated into a field instance. */ -class MigrateCommentVariableInstance extends MigrateDrupalTestBase { +class MigrateCommentVariableInstance extends MigrateDrupal6TestBase { static $modules = array('comment', 'node'); @@ -55,10 +56,7 @@ public function setUp() { ))->save(); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_comment_field_instance'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6CommentVariable.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6CommentVariable()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateContactCategoryTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateContactCategoryTest.php index 899d08c..4c6010f 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateContactCategoryTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateContactCategoryTest.php @@ -9,12 +9,13 @@ use Drupal\migrate\MigrateExecutable; use Drupal\migrate\MigrateMessage; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6ContactCategory; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * The Drupal 6 contact categories to Drupal 8 migration. */ -class MigrateContactCategoryTest extends MigrateDrupalTestBase { +class MigrateContactCategoryTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -40,11 +41,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_contact_category'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6ContactCategory.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6ContactCategory()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateContactConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateContactConfigsTest.php index bd56509..dc43b77 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateContactConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateContactConfigsTest.php @@ -9,12 +9,13 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6ContactSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables from the Contact module. */ -class MigrateContactConfigsTest extends MigrateDrupalTestBase { +class MigrateContactConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -39,11 +40,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_contact_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6ContactSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6ContactSettings()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCustomBlockTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCustomBlockTest.php index eb9da18..5ea1237 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCustomBlockTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCustomBlockTest.php @@ -10,12 +10,13 @@ use Drupal\Core\Language\Language; use Drupal\custom_block\Entity\CustomBlock; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6Box; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 custom block to Drupal 8 migration. */ -class MigrateCustomBlockTest extends MigrateDrupalTestBase { +class MigrateCustomBlockTest extends MigrateDrupal6TestBase { static $modules = array('block', 'custom_block'); @@ -42,10 +43,7 @@ public function setUp() { )); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_custom_block'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6Box.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6Box()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateDateFormatTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateDateFormatTest.php index a79df39..e0c7d67 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateDateFormatTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateDateFormatTest.php @@ -5,13 +5,14 @@ use Drupal\Core\Datetime\DrupalDateTime; use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6DateFormat; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; use Drupal\Core\Database\Database; /** * Tests the Drupal 6 date formats to Drupal 8 migration. */ -class MigrateDateFormatTest extends MigrateDrupalTestBase { +class MigrateDateFormatTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -31,10 +32,7 @@ public function setUp() { parent::setUp(); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_date_formats'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6DateFormat.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dumps(array(new Drupal6DateFormat())); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } @@ -59,6 +57,7 @@ public function testDateFormats() { ->condition('name', 'date_format_short') ->execute(); db_truncate(entity_load('migration', 'd6_date_formats')->getIdMap()->mapTableName())->execute(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load_unchanged('migration', 'd6_date_formats'); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateDblogConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateDblogConfigsTest.php index e4753f4..cc99589 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateDblogConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateDblogConfigsTest.php @@ -9,12 +9,13 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6DblogSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables from the dblog module. */ -class MigrateDblogConfigsTest extends MigrateDrupalTestBase { +class MigrateDblogConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -39,11 +40,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_dblog_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6DblogSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6DblogSettings()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateDrupal6Test.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateDrupal6Test.php index 1e393a6..694dcbc 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateDrupal6Test.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateDrupal6Test.php @@ -8,13 +8,14 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; use Drupal\simpletest\TestBase; /** * Test the complete Drupal 6 migration. */ -class MigrateDrupal6Test extends MigrateDrupalTestBase { +class MigrateDrupal6Test extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -79,68 +80,68 @@ public function tearDown() { * Test the complete Drupal 6 migration. */ public function testDrupal6() { - $tests_path = $this->getDumpDirectory(); - $dumps = array( - $tests_path . '/Drupal6ActionSettings.php', - $tests_path . '/Drupal6AggregatorFeed.php', - $tests_path . '/Drupal6AggregatorItem.php', - $tests_path . '/Drupal6AggregatorSettings.php', - $tests_path . '/Drupal6Block.php', - $tests_path . '/Drupal6BookSettings.php', - $tests_path . '/Drupal6Box.php', - $tests_path . '/Drupal6Comment.php', - $tests_path . '/Drupal6CommentVariable.php', - $tests_path . '/Drupal6ContactCategory.php', - $tests_path . '/Drupal6ContactSettings.php', - $tests_path . '/Drupal6DateFormat.php', - $tests_path . '/Drupal6DblogSettings.php', - $tests_path . '/Drupal6FieldInstance.php', - $tests_path . '/Drupal6FieldSettings.php', - $tests_path . '/Drupal6File.php', - $tests_path . '/Drupal6FileSettings.php', - $tests_path . '/Drupal6FilterFormat.php', - $tests_path . '/Drupal6ForumSettings.php', - $tests_path . '/Drupal6LocaleSettings.php', - $tests_path . '/Drupal6Menu.php', - $tests_path . '/Drupal6MenuSettings.php', - $tests_path . '/Drupal6NodeBodyInstance.php', - $tests_path . '/Drupal6Node.php', - $tests_path . '/Drupal6NodeRevision.php', - $tests_path . '/Drupal6NodeSettings.php', - $tests_path . '/Drupal6NodeType.php', - $tests_path . '/Drupal6SearchPage.php', - $tests_path . '/Drupal6SearchSettings.php', - $tests_path . '/Drupal6SimpletestSettings.php', - $tests_path . '/Drupal6StatisticsSettings.php', - $tests_path . '/Drupal6SyslogSettings.php', - $tests_path . '/Drupal6SystemCron.php', + + $this->loadDrupal6Dumps(array( + new Dump\Drupal6ActionSettings(), + new Dump\Drupal6AggregatorFeed(), + new Dump\Drupal6AggregatorItem(), + new Dump\Drupal6AggregatorSettings(), + new Dump\Drupal6Block(), + new Dump\Drupal6BookSettings(), + new Dump\Drupal6Box(), + new Dump\Drupal6Comment(), + new Dump\Drupal6CommentVariable(), + new Dump\Drupal6ContactCategory(), + new Dump\Drupal6ContactSettings(), + new Dump\Drupal6DateFormat(), + new Dump\Drupal6DblogSettings(), + new Dump\Drupal6FieldInstance(), + new Dump\Drupal6FieldSettings(), + new Dump\Drupal6File(), + new Dump\Drupal6FileSettings(), + new Dump\Drupal6FilterFormat(), + new Dump\Drupal6ForumSettings(), + new Dump\Drupal6LocaleSettings(), + new Dump\Drupal6Menu(), + new Dump\Drupal6MenuSettings(), + new Dump\Drupal6NodeBodyInstance(), + new Dump\Drupal6Node(), + new Dump\Drupal6NodeRevision(), + new Dump\Drupal6NodeSettings(), + new Dump\Drupal6NodeType(), + new Dump\Drupal6SearchPage(), + new Dump\Drupal6SearchSettings(), + new Dump\Drupal6SimpletestSettings(), + new Dump\Drupal6StatisticsSettings(), + new Dump\Drupal6SyslogSettings(), + new Dump\Drupal6SystemCron(), // This dump contains the file directory path to the simpletest directory // where the files are. - $tests_path . '/Drupal6SystemFile.php', - $tests_path . '/Drupal6SystemFilter.php', - $tests_path . '/Drupal6SystemImageGd.php', - $tests_path . '/Drupal6SystemImage.php', - $tests_path . '/Drupal6SystemMaintenance.php', - $tests_path . '/Drupal6SystemPerformance.php', - $tests_path . '/Drupal6SystemRss.php', - $tests_path . '/Drupal6SystemSite.php', - $tests_path . '/Drupal6SystemTheme.php', - $tests_path . '/Drupal6TaxonomySettings.php', - $tests_path . '/Drupal6TaxonomyTerm.php', - $tests_path . '/Drupal6TaxonomyVocabulary.php', - $tests_path . '/Drupal6TermNode.php', - $tests_path . '/Drupal6TextSettings.php', - $tests_path . '/Drupal6UpdateSettings.php', - $tests_path . '/Drupal6UploadInstance.php', - $tests_path . '/Drupal6Upload.php', - $tests_path . '/Drupal6UrlAlias.php', - $tests_path . '/Drupal6UserMail.php', - $tests_path . '/Drupal6User.php', - $tests_path . '/Drupal6UserProfileFields.php', - $tests_path . '/Drupal6UserRole.php', - $tests_path . '/Drupal6VocabularyField.php', - ); - $this->loadDumps($dumps); + new Dump\Drupal6SystemFile(), + new Dump\Drupal6SystemFilter(), + new Dump\Drupal6SystemImageGd(), + new Dump\Drupal6SystemImage(), + new Dump\Drupal6SystemMaintenance(), + new Dump\Drupal6SystemPerformance(), + new Dump\Drupal6SystemRss(), + new Dump\Drupal6SystemSite(), + new Dump\Drupal6SystemTheme(), + new Dump\Drupal6TaxonomySettings(), + new Dump\Drupal6TaxonomyTerm(), + new Dump\Drupal6TaxonomyVocabulary(), + new Dump\Drupal6TermNode(), + new Dump\Drupal6TextSettings(), + new Dump\Drupal6UpdateSettings(), + new Dump\Drupal6UploadInstance(), + new Dump\Drupal6Upload(), + new Dump\Drupal6UrlAlias(), + new Dump\Drupal6UserMail(), + new Dump\Drupal6User(), + new Dump\Drupal6UserProfileFields(), + new Dump\Drupal6UserRole(), + new Dump\Drupal6VocabularyField(), + )); + $migrations = array( 'd6_action_settings', 'd6_aggregator_settings', @@ -223,6 +224,7 @@ public function testDrupal6() { 'd6_vocabulary_field_instance', 'd6_vocabulary_field', ); + $classes = array( __NAMESPACE__ . '\MigrateActionConfigsTest', __NAMESPACE__ . '\MigrateAggregatorConfigsTest', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldConfigsTest.php index 4a7e340..c85e347 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldConfigsTest.php @@ -8,12 +8,14 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; + +use Drupal\migrate_drupal\Tests\Dump\Drupal6FieldSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables from the Field module. */ -class MigrateFieldConfigsTest extends MigrateDrupalTestBase { +class MigrateFieldConfigsTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -31,11 +33,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_field_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6FieldSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6FieldSettings()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldFormatterSettingsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldFormatterSettingsTest.php index 683a0f1..f067554 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldFormatterSettingsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldFormatterSettingsTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6FieldInstance; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Test formatter settings to display modes. */ -class MigrateFieldFormatterSettingsTest extends MigrateDrupalTestBase { +class MigrateFieldFormatterSettingsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -72,11 +73,9 @@ public function setUp() { ); $this->prepareIdMappings($id_mappings); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_field_formatter_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6FieldInstance.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6FieldInstance()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldInstanceTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldInstanceTest.php index 4bd26f7..b6fca56 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldInstanceTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldInstanceTest.php @@ -8,13 +8,14 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6FieldInstance; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; use Drupal\link\LinkItemInterface; /** * Tests migration of field instances. */ -class MigrateFieldInstanceTest extends MigrateDrupalTestBase { +class MigrateFieldInstanceTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -73,13 +74,10 @@ public function setUp() { entity_create('node_type', array('type' => 'story'))->save(); entity_create('node_type', array('type' => 'article'))->save(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_field_instance'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6FieldInstance.php', - ); $this->createFields(); - - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6FieldInstance()); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldTest.php index a6737f0..3b2ddbb 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6FieldInstance; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 field to Drupal 8 migration. */ -class MigrateFieldTest extends MigrateDrupalTestBase { +class MigrateFieldTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -40,10 +41,7 @@ public function setUp() { parent::setUp(); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_field'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6FieldInstance.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6FieldInstance()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldWidgetSettingsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldWidgetSettingsTest.php index c18691f..1fbebb9 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldWidgetSettingsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFieldWidgetSettingsTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6FieldInstance; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of field instances. */ -class MigrateFieldWidgetSettingsTest extends MigrateDrupalTestBase { +class MigrateFieldWidgetSettingsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -70,11 +71,9 @@ public function setUp() { ), ); $this->prepareIdMappings($id_mappings); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_field_instance_widget_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6FieldInstance.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6FieldInstance()); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFileConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFileConfigsTest.php index fc7edc4..5f15568 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFileConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFileConfigsTest.php @@ -9,12 +9,13 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6FileSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables from the File module. */ -class MigrateFileConfigsTest extends MigrateDrupalTestBase { +class MigrateFileConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -39,11 +40,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_file_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6FileSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6FileSettings()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFileTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFileTest.php index 9e5c6ab..272337a 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFileTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFileTest.php @@ -8,12 +8,15 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6File; + +use Drupal\migrate_drupal\Tests\Dump\Drupal6SystemFileStandalone; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 files to Drupal 8 migration. */ -class MigrateFileTest extends MigrateDrupalTestBase { +class MigrateFileTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -38,13 +41,10 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6File.php', - ); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_file'); $migration->source['conf_path'] = 'core/modules/simpletest'; - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6File()); $executable = new MigrateExecutable($migration, $this); $executable->import(); $this->standalone = TRUE; @@ -67,11 +67,9 @@ public function testFiles() { // Test that we can re-import and also test with file_directory_path set. db_truncate(entity_load('migration', 'd6_file')->getIdMap()->mapTableName())->execute(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load_unchanged('migration', 'd6_file'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6SystemFile.php', - ); - $this->loadDumps($dumps, 'loadMigrateFileStandalone'); + $this->loadDrupal6Dump(new Drupal6SystemFileStandalone()); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFilterFormatTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFilterFormatTest.php index 47a3f32..06c17cd 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFilterFormatTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateFilterFormatTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6FilterFormat; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 filter format to Drupal 8 migration. */ -class MigrateFilterFormatTest extends MigrateDrupalTestBase { +class MigrateFilterFormatTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -37,11 +38,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_filter_format'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6FilterFormat.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6FilterFormat()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateForumConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateForumConfigsTest.php index d5fb297..bb89ab7 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateForumConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateForumConfigsTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6ForumSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables for the Forum module. */ -class MigrateForumConfigsTest extends MigrateDrupalTestBase { +class MigrateForumConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -38,11 +39,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_forum_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6ForumSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6ForumSettings()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateLocaleConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateLocaleConfigsTest.php index de89d92..b68b60f 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateLocaleConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateLocaleConfigsTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6LocaleSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables from the Locale module. */ -class MigrateLocaleConfigsTest extends MigrateDrupalTestBase { +class MigrateLocaleConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -38,11 +39,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_locale_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6LocaleSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6LocaleSettings()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateMenuConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateMenuConfigsTest.php index 404f281..b913f49 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateMenuConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateMenuConfigsTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6MenuSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables for the Menu UI module. */ -class MigrateMenuConfigsTest extends MigrateDrupalTestBase { +class MigrateMenuConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -38,11 +39,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_menu_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6MenuSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6MenuSettings()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateMenuTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateMenuTest.php index d2839cb..0c01a3d 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateMenuTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateMenuTest.php @@ -9,13 +9,14 @@ use Drupal\migrate\MigrateExecutable; use Drupal\migrate\MigrateMessage; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6Menu; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; use Drupal\Core\Database\Database; /** * Tests the Drupal 6 menu to Drupal 8 migration. */ -class MigrateMenuTest extends MigrateDrupalTestBase { +class MigrateMenuTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -33,11 +34,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_menu'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6Menu.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6Menu()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } @@ -59,6 +58,7 @@ public function testMenu() { ->execute(); db_truncate(entity_load('migration', 'd6_menu')->getIdMap()->mapTableName())->execute(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load_unchanged('migration', 'd6_menu'); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeConfigsTest.php index 165fe13..20add8b 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeConfigsTest.php @@ -9,12 +9,13 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6NodeSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests Drupal 6 node settings to Drupal 8 migration. */ -class MigrateNodeConfigsTest extends MigrateDrupalTestBase { +class MigrateNodeConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -39,11 +40,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_node_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6NodeSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6NodeSettings()); $executable = new MigrateExecutable($migration, new MigrateMessage); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeRevisionTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeRevisionTest.php index b121227..5516839 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeRevisionTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeRevisionTest.php @@ -8,6 +8,7 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; +use Drupal\migrate_drupal\Tests\Dump\Drupal6NodeRevision; /** * Test node revisions migration from Drupal 6 to 8. @@ -36,11 +37,7 @@ protected function setUp() { ), ); $this->prepareIdMappings($id_mappings); - - $dumps = array( - $this->getDumpDirectory() . '/Drupal6NodeRevision.php', - ); - $this->loadDumps($dumps); + $this->loadDrupal6Dump(new Drupal6NodeRevision()); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_node_revision'); $executable = new MigrateExecutable($migration, $this); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeTestBase.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeTestBase.php index 26a4c34..ab57a47 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeTestBase.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeTestBase.php @@ -7,9 +7,12 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6FieldInstance; +use Drupal\migrate_drupal\Tests\Dump\Drupal6Node; +use Drupal\migrate_drupal\Tests\Dump\Drupal6NodeType; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; -class MigrateNodeTestBase extends MigrateDrupalTestBase { +class MigrateNodeTestBase extends MigrateDrupal6TestBase { static $modules = array('node'); @@ -43,12 +46,11 @@ protected function setUp() { $node->save(); // Load dumps. - $dumps = array( - $this->getDumpDirectory() . '/Drupal6Node.php', - $this->getDumpDirectory() . '/Drupal6NodeType.php', - $this->getDumpDirectory() . '/Drupal6FieldInstance.php', - ); - $this->loadDumps($dumps); + $this->loadDrupal6Dumps(array( + new Drupal6Node(), + new Drupal6NodeType(), + new Drupal6FieldInstance(), + )); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeTypeTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeTypeTest.php index 3c72ad9..e0cd41b 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeTypeTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeTypeTest.php @@ -9,12 +9,13 @@ use Drupal\field\Field; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6NodeType; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests Drupal 6 node type to Drupal 8 migration. */ -class MigrateNodeTypeTest extends MigrateDrupalTestBase { +class MigrateNodeTypeTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -39,11 +40,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_node_type'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6NodeType.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6NodeType()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateProfileValuesTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateProfileValuesTest.php index e3e6d7e..0801542 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateProfileValuesTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateProfileValuesTest.php @@ -10,12 +10,12 @@ use Drupal\migrate\MigrateExecutable; use Drupal\migrate_drupal\Tests\Dump\Drupal6User; use Drupal\migrate_drupal\Tests\Dump\Drupal6UserProfileFields; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests Drupal 6 profile values to Drupal 8 migration. */ -class MigrateProfileValuesTest extends MigrateDrupalTestBase { +class MigrateProfileValuesTest extends MigrateDrupal6TestBase { /** * The modules to be enabled during the test. @@ -123,13 +123,13 @@ protected function setUp() { $this->prepareIdMappings($id_mappings); // Load database dumps to provide source data. - $dumps = array( - $this->getDumpDirectory() . '/Drupal6UserProfileFields.php', - $this->getDumpDirectory() . '/Drupal6User.php', - ); - $this->loadDumps($dumps); + $this->loadDrupal6Dumps(array( + new Drupal6UserProfileFields(), + new Drupal6User(), + )); // Migrate profile fields. + /** @var \Drupal\migrate\Entity\Migration $migration_format */ $migration_format = entity_load('migration', 'd6_profile_values:user'); $executable = new MigrateExecutable($migration_format, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSearchConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSearchConfigsTest.php index c2c5dbf..262979d 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSearchConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSearchConfigsTest.php @@ -9,12 +9,13 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6SearchSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables for the Search module. */ -class MigrateSearchConfigsTest extends MigrateDrupalTestBase { +class MigrateSearchConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -39,11 +40,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_search_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6SearchSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6SearchSettings()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSearchPageTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSearchPageTest.php index 838116b..cd061d5 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSearchPageTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSearchPageTest.php @@ -8,13 +8,14 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6SearchPage; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; use Drupal\Core\Database\Database; /** * Tests Drupal 6 search settings to Drupal 8 search page entity migration. */ -class MigrateSearchPageTest extends MigrateDrupalTestBase { +class MigrateSearchPageTest extends MigrateDrupal6TestBase { /** * The modules to be enabled during the test. @@ -41,10 +42,7 @@ protected function setUp() { parent::setUp(); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_search_page'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6SearchPage.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6SearchPage()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } @@ -73,6 +71,7 @@ public function testSearchPage() { ->condition('name', 'node_rank_comments') ->execute(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load_unchanged('migration', 'd6_search_page'); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSimpletestConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSimpletestConfigsTest.php index 688410b..4ee6af0 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSimpletestConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSimpletestConfigsTest.php @@ -9,12 +9,13 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6SimpletestSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables from the Simpletest module. */ -class MigrateSimpletestConfigsTest extends MigrateDrupalTestBase { +class MigrateSimpletestConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -39,11 +40,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_simpletest_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6SimpletestSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6SimpletestSettings()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateStatisticsConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateStatisticsConfigsTest.php index eaac333..82566c4 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateStatisticsConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateStatisticsConfigsTest.php @@ -9,12 +9,13 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6StatisticsSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables from the Statistics module. */ -class MigrateStatisticsConfigsTest extends MigrateDrupalTestBase { +class MigrateStatisticsConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -39,11 +40,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_statistics_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6StatisticsSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6StatisticsSettings()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSyslogConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSyslogConfigsTest.php index 587bbb8..aa69637 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSyslogConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSyslogConfigsTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6SyslogSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables from the Syslog module. */ -class MigrateSyslogConfigsTest extends MigrateDrupalTestBase { +class MigrateSyslogConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -38,11 +39,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_syslog_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6SyslogSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6SyslogSettings()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemCronTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemCronTest.php index 764dbac..0cb5fdb 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemCronTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemCronTest.php @@ -9,12 +9,13 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6SystemCron; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 cron variables to Drupal 8 system.cron config migration. */ -class MigrateSystemCronTest extends MigrateDrupalTestBase { +class MigrateSystemCronTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -32,11 +33,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_system_cron'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6SystemCron.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6SystemCron()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemFileTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemFileTest.php index 6e9b6f8..c1560df 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemFileTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemFileTest.php @@ -9,9 +9,10 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6SystemFile; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; -class MigrateSystemFileTest extends MigrateDrupalTestBase { +class MigrateSystemFileTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -29,11 +30,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_system_file'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6SystemFile.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6SystemFile()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemFilterTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemFilterTest.php index d501cc5..b877125 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemFilterTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemFilterTest.php @@ -9,12 +9,13 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6SystemFilter; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 system filter variables to Drupal 8 system.filter config migration. */ -class MigrateSystemFilterTest extends MigrateDrupalTestBase { +class MigrateSystemFilterTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -32,11 +33,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_system_filter'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6SystemFilter.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6SystemFilter()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemImageGdTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemImageGdTest.php index 919d794..f23aba2 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemImageGdTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemImageGdTest.php @@ -9,9 +9,10 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6SystemImageGd; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; -class MigrateSystemImageGdTest extends MigrateDrupalTestBase { +class MigrateSystemImageGdTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -29,11 +30,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_system_image_gd'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6SystemImageGd.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6SystemImageGd()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemImageTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemImageTest.php index 4f1dbac..0c47a73 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemImageTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemImageTest.php @@ -9,9 +9,10 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6SystemImage; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; -class MigrateSystemImageTest extends MigrateDrupalTestBase { +class MigrateSystemImageTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -29,11 +30,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_system_image'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6SystemImage.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6SystemImage()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemMaintenanceTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemMaintenanceTest.php index 70b78d3..cb7d851 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemMaintenanceTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemMaintenanceTest.php @@ -9,9 +9,10 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6SystemMaintenance; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; -class MigrateSystemMaintenanceTest extends MigrateDrupalTestBase { +class MigrateSystemMaintenanceTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -29,11 +30,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_system_maintenance'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6SystemMaintenance.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6SystemMaintenance()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemPerformanceTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemPerformanceTest.php index ec98b7e..3a3e944 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemPerformanceTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemPerformanceTest.php @@ -9,9 +9,10 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6SystemPerformance; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; -class MigrateSystemPerformanceTest extends MigrateDrupalTestBase { +class MigrateSystemPerformanceTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -29,11 +30,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_system_performance'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6SystemPerformance.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6SystemPerformance()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemRssTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemRssTest.php index 1584910..d585296 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemRssTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemRssTest.php @@ -9,9 +9,10 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6SystemRss; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; -class MigrateSystemRssTest extends MigrateDrupalTestBase { +class MigrateSystemRssTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -29,11 +30,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_system_rss'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6SystemRss.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6SystemRss()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemSiteTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemSiteTest.php index f4df9cf..23e2823 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemSiteTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemSiteTest.php @@ -9,9 +9,10 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6SystemSite; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; -class MigrateSystemSiteTest extends MigrateDrupalTestBase { +class MigrateSystemSiteTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -29,11 +30,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_system_site'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6SystemSite.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6SystemSite()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemThemeTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemThemeTest.php index b5c0ff5..71aaffe 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemThemeTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateSystemThemeTest.php @@ -9,9 +9,10 @@ use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6SystemTheme; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; -class MigrateSystemThemeTest extends MigrateDrupalTestBase { +class MigrateSystemThemeTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -29,11 +30,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_system_theme'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6SystemTheme.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6SystemTheme()); $executable = new MigrateExecutable($migration, new MigrateMessage()); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyConfigsTest.php index b89874b..c466d4d 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyConfigsTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6TaxonomySettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables from the Taxonomy module. */ -class MigrateTaxonomyConfigsTest extends MigrateDrupalTestBase { +class MigrateTaxonomyConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -38,11 +39,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_taxonomy_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6TaxonomySettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6TaxonomySettings()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyTermTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyTermTest.php index a4f5b13..312bbcf 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyTermTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyTermTest.php @@ -8,13 +8,15 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6TaxonomyTerm; +use Drupal\migrate_drupal\Tests\Dump\Drupal6TaxonomyVocabulary; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; use Drupal\taxonomy\Entity\Term; /** * Tests the Drupal 6 taxonomy term to Drupal 8 migration. */ -class MigrateTaxonomyTermTest extends MigrateDrupalTestBase { +class MigrateTaxonomyTermTest extends MigrateDrupal6TestBase { static $modules = array('taxonomy'); @@ -43,10 +45,10 @@ protected function setUp() { /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_taxonomy_term'); $dumps = array( - $this->getDumpDirectory() . '/Drupal6TaxonomyTerm.php', - $this->getDumpDirectory() . '/Drupal6TaxonomyVocabulary.php', + new Drupal6TaxonomyTerm(), + new Drupal6TaxonomyVocabulary(), ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dumps($dumps); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyVocabularyTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyVocabularyTest.php index 719cd86..91dc53a 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyVocabularyTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTaxonomyVocabularyTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6TaxonomyVocabulary; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 taxonomy vocabularies to Drupal 8 migration. */ -class MigrateTaxonomyVocabularyTest extends MigrateDrupalTestBase { +class MigrateTaxonomyVocabularyTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -39,11 +40,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_taxonomy_vocabulary'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6TaxonomyVocabulary.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6TaxonomyVocabulary()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTermNodeTestBase.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTermNodeTestBase.php index e7b64d1..ffe3350 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTermNodeTestBase.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTermNodeTestBase.php @@ -7,9 +7,13 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6Node; +use Drupal\migrate_drupal\Tests\Dump\Drupal6TaxonomyTerm; +use Drupal\migrate_drupal\Tests\Dump\Drupal6TaxonomyVocabulary; +use Drupal\migrate_drupal\Tests\Dump\Drupal6TermNode; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; -class MigrateTermNodeTestBase extends MigrateDrupalTestBase { +class MigrateTermNodeTestBase extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -83,13 +87,12 @@ protected function setUp() { $node->save(); } } - $dumps = array( - $this->getDumpDirectory() . '/Drupal6Node.php', - $this->getDumpDirectory() . '/Drupal6TermNode.php', - $this->getDumpDirectory() . '/Drupal6TaxonomyTerm.php', - $this->getDumpDirectory() . '/Drupal6TaxonomyVocabulary.php', - ); - $this->loadDumps($dumps); + $this->loadDrupal6Dumps(array( + new Drupal6Node(), + new Drupal6TermNode(), + new Drupal6TaxonomyTerm(), + new Drupal6TaxonomyVocabulary(), + )); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTextConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTextConfigsTest.php index 04e659b..33b1831 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTextConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateTextConfigsTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6TextSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables from the Text module. */ -class MigrateTextConfigsTest extends MigrateDrupalTestBase { +class MigrateTextConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -38,11 +39,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_text_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6TextSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6TextSettings()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUpdateConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUpdateConfigsTest.php index 444fa7f..ae756a3 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUpdateConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUpdateConfigsTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6UpdateSettings; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables from the Update module. */ -class MigrateUpdateConfigsTest extends MigrateDrupalTestBase { +class MigrateUpdateConfigsTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -38,11 +39,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_update_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6UpdateSettings.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6UpdateSettings()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadBase.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadBase.php index c730cf1..e448986 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadBase.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadBase.php @@ -7,9 +7,11 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6Node; +use Drupal\migrate_drupal\Tests\Dump\Drupal6Upload; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; -class MigrateUploadBase extends MigrateDrupalTestBase { +class MigrateUploadBase extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -81,11 +83,10 @@ public function setUp() { $node->save(); } } - $dumps = array( - $this->getDumpDirectory() . '/Drupal6Node.php', - $this->getDumpDirectory() . '/Drupal6Upload.php', - ); - $this->loadDumps($dumps); + $this->loadDrupal6Dumps(array( + new Drupal6Node(), + new Drupal6Upload(), + )); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadEntityDisplayTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadEntityDisplayTest.php index ec994b6..0843137 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadEntityDisplayTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadEntityDisplayTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6UploadInstance; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 upload settings to Drupal 8 entity display migration. */ -class MigrateUploadEntityDisplayTest extends MigrateDrupalTestBase { +class MigrateUploadEntityDisplayTest extends MigrateDrupal6TestBase { /** * The modules to be enabled during the test. @@ -50,11 +51,9 @@ protected function setUp() { ); $this->prepareIdMappings($id_mappings); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_upload_entity_display'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6UploadInstance.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6UploadInstance()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadEntityFormDisplayTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadEntityFormDisplayTest.php index 9d58993..2ac55e7 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadEntityFormDisplayTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6UploadInstance; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 upload settings to Drupal 8 entity form display migration. */ -class MigrateUploadEntityFormDisplayTest extends MigrateDrupalTestBase { +class MigrateUploadEntityFormDisplayTest extends MigrateDrupal6TestBase { /** * The modules to be enabled during the test. @@ -50,11 +51,9 @@ protected function setUp() { ); $this->prepareIdMappings($id_mappings); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_upload_entity_form_display'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6UploadInstance.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6UploadInstance()); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadFieldTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadFieldTest.php index ceac437..8cc9556 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadFieldTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadFieldTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6UploadField; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 upload settings to Drupal 8 field migration. */ -class MigrateUploadFieldTest extends MigrateDrupalTestBase { +class MigrateUploadFieldTest extends MigrateDrupal6TestBase { /** * The modules to be enabled during the test. @@ -38,13 +39,11 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_upload_field'); $executable = new MigrateExecutable($migration, $this); $executable->import(); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6UploadField.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6UploadField()); } /** diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadInstanceTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadInstanceTest.php index e12f04b..95e812f 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadInstanceTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUploadInstanceTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6UploadInstance; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 upload settings to Drupal 8 field instance migration. */ -class MigrateUploadInstanceTest extends MigrateDrupalTestBase { +class MigrateUploadInstanceTest extends MigrateDrupal6TestBase { /** * The modules to be enabled during the test. @@ -56,11 +57,9 @@ protected function setUp() { 'translatable' => '0', ))->save(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_upload_field_instance'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6UploadInstance.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6UploadInstance()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUrlAliasTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUrlAliasTest.php index bec9a4e..749a7f8 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUrlAliasTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUrlAliasTest.php @@ -9,13 +9,14 @@ use Drupal\migrate\MigrateExecutable; use Drupal\migrate\Plugin\MigrateIdMapInterface; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6UrlAlias; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; use Drupal\Core\Database\Database; /** * Test the url alias migration. */ -class MigrateUrlAliasTest extends MigrateDrupalTestBase { +class MigrateUrlAliasTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -33,11 +34,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_url_alias'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6UrlAlias.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6UrlAlias()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } @@ -74,6 +73,7 @@ public function testUrlAlias() { db_update($migration->getIdMap()->mapTableName()) ->fields(array('source_row_status' => MigrateIdMapInterface::STATUS_NEEDS_UPDATE)) ->execute(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load_unchanged('migration', 'd6_url_alias'); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserConfigsTest.php index ac5c9d3..cd99acf 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserConfigsTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6UserMail; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of variables from the User module. */ -class MigrateUserConfigsTest extends MigrateDrupalTestBase { +class MigrateUserConfigsTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} @@ -31,11 +32,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_user_mail'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6UserMail.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6UserMail()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureEntityDisplayTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureEntityDisplayTest.php index 3919c7f..1bf16c1 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureEntityDisplayTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureEntityDisplayTest.php @@ -8,12 +8,12 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 user picture to Drupal 8 entity display migration. */ -class MigrateUserPictureEntityDisplayTest extends MigrateDrupalTestBase { +class MigrateUserPictureEntityDisplayTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -46,6 +46,7 @@ public function setUp() { ); $this->prepareIdMappings($id_mappings); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_user_picture_entity_display'); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php index c4de81b..1e50375 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php @@ -8,12 +8,12 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 user picture to Drupal 8 entity form display migration. */ -class MigrateUserPictureEntityFormDisplayTest extends MigrateDrupalTestBase { +class MigrateUserPictureEntityFormDisplayTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -45,6 +45,7 @@ public function setUp() { ); $this->prepareIdMappings($id_mappings); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_user_picture_entity_form_display'); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureFieldTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureFieldTest.php index 9184d2c..7286d8e 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureFieldTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureFieldTest.php @@ -8,12 +8,12 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Test the user_picture field migration. */ -class MigrateUserPictureFieldTest extends MigrateDrupalTestBase { +class MigrateUserPictureFieldTest extends MigrateDrupal6TestBase { static $modules = array('image'); @@ -33,6 +33,7 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_user_picture_field'); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureFileTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureFileTest.php index 7fe2895..28d2ea6 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureFileTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureFileTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6User; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 user pictures to Drupal 8 migration. */ -class MigrateUserPictureFileTest extends MigrateDrupalTestBase { +class MigrateUserPictureFileTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -38,13 +39,10 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6User.php', - ); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_user_picture_file'); $migration->source['conf_path'] = 'core/modules/simpletest'; - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6User()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureInstanceTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureInstanceTest.php index f6881de..d8410a8 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureInstanceTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserPictureInstanceTest.php @@ -8,12 +8,12 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 user picture to Drupal 8 picture field instance migration. */ -class MigrateUserPictureInstanceTest extends MigrateDrupalTestBase { +class MigrateUserPictureInstanceTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -52,6 +52,7 @@ public function setUp() { 'translatable' => '0', ))->save(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_user_picture_field_instance'); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileEntityDisplayTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileEntityDisplayTest.php index 372126f..56706a9 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileEntityDisplayTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileEntityDisplayTest.php @@ -8,13 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; use Drupal\migrate_drupal\Tests\Dump\Drupal6UserProfileFields; /** * Tests migration of user profile fields. */ -class MigrateUserProfileEntityDisplayTest extends MigrateDrupalTestBase { +class MigrateUserProfileEntityDisplayTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -89,11 +89,9 @@ protected function setUp() { ))->save(); } + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_user_profile_entity_display'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6UserProfileFields.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6UserProfileFields()); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php index 40257e9..cd2dd86 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php @@ -8,13 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; use Drupal\migrate_drupal\Tests\Dump\Drupal6UserProfileFields; /** * Tests migration of user profile entity form display. */ -class MigrateUserProfileEntityFormDisplayTest extends MigrateDrupalTestBase { +class MigrateUserProfileEntityFormDisplayTest extends MigrateDrupal6TestBase { static $modules = array('link', 'options', 'datetime'); @@ -84,11 +84,9 @@ protected function setUp() { ))->save(); } + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_user_profile_entity_form_display'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6UserProfileFields.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6UserProfileFields()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileFieldInstanceTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileFieldInstanceTest.php index 7393fea..fa06dfd 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileFieldInstanceTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileFieldInstanceTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6UserProfileFields; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of user profile fields. */ -class MigrateUserProfileFieldInstanceTest extends MigrateDrupalTestBase { +class MigrateUserProfileFieldInstanceTest extends MigrateDrupal6TestBase { static $modules = array('field', 'link', 'options', 'datetime', 'text'); @@ -43,10 +44,7 @@ protected function setUp() { $this->createFields(); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_user_profile_field_instance'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6UserProfileFields.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6UserProfileFields()); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileFieldTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileFieldTest.php index 696695c..8530c69 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileFieldTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserProfileFieldTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6UserProfileFields; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests migration of user profile fields. */ -class MigrateUserProfileFieldTest extends MigrateDrupalTestBase { +class MigrateUserProfileFieldTest extends MigrateDrupal6TestBase { static $modules = array('link', 'options', 'datetime'); @@ -33,11 +34,9 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_user_profile_field'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6UserProfileFields.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6UserProfileFields()); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserRoleTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserRoleTest.php index dffb1d2..e5f902d 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserRoleTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserRoleTest.php @@ -8,12 +8,14 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6FilterFormat; +use Drupal\migrate_drupal\Tests\Dump\Drupal6UserRole; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 user roles to Drupal 8 migration. */ -class MigrateUserRoleTest extends MigrateDrupalTestBase { +class MigrateUserRoleTest extends MigrateDrupal6TestBase { /** * The modules to be enabled during the test. @@ -50,10 +52,10 @@ public function setUp() { /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_user_role'); $dumps = array( - $this->getDumpDirectory() . '/Drupal6UserRole.php', - $this->getDumpDirectory() . '/Drupal6FilterFormat.php', + new Drupal6UserRole(), + new Drupal6FilterFormat(), ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dumps($dumps); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserTest.php index d894b1c..d8fe499 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateUserTest.php @@ -9,12 +9,16 @@ use Drupal\Core\Database\Database; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6FilterFormat; +use Drupal\migrate_drupal\Tests\Dump\Drupal6User; +use Drupal\migrate_drupal\Tests\Dump\Drupal6UserProfileFields; +use Drupal\migrate_drupal\Tests\Dump\Drupal6UserRole; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal6 user to Drupal 8 migration. */ -class MigrateUserTest extends MigrateDrupalTestBase { +class MigrateUserTest extends MigrateDrupal6TestBase { /** * The modules to be enabled during the test. @@ -91,13 +95,12 @@ protected function setUp() { $file->save(); // Load database dumps to provide source data. - $dumps = array( - $this->getDumpDirectory() . '/Drupal6FilterFormat.php', - $this->getDumpDirectory() . '/Drupal6UserProfileFields.php', - $this->getDumpDirectory() . '/Drupal6UserRole.php', - $this->getDumpDirectory() . '/Drupal6User.php', - ); - $this->loadDumps($dumps); + $this->loadDrupal6Dumps(array( + new Drupal6FilterFormat(), + new Drupal6UserProfileFields(), + new Drupal6UserRole(), + new Drupal6User(), + )); $id_mappings = array( 'd6_filter_format' => array( @@ -127,6 +130,7 @@ protected function setUp() { $this->prepareIdMappings($id_mappings); // Migrate users. + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_user'); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateViewModesTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateViewModesTest.php index 2c43aee..82665fc 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateViewModesTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateViewModesTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6FieldInstance; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests Drupal 6 view modes to Drupal 8 migration. */ -class MigrateViewModesTest extends MigrateDrupalTestBase { +class MigrateViewModesTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -38,11 +39,9 @@ public static function getInfo() { */ public function setUp() { parent::setUp(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_view_modes'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6FieldInstance.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6FieldInstance()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyEntityDisplayTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyEntityDisplayTest.php index 4b7066c..185d85b 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyEntityDisplayTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyEntityDisplayTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6VocabularyField; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 vocabulary-node type association to Drupal 8 migration. */ -class MigrateVocabularyEntityDisplayTest extends MigrateDrupalTestBase { +class MigrateVocabularyEntityDisplayTest extends MigrateDrupal6TestBase { /** * The modules to be enabled during the test. @@ -68,11 +69,9 @@ protected function setUp() { ); $this->prepareIdMappings($id_mappings); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_vocabulary_entity_display'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6VocabularyField.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6VocabularyField()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php index 00022f6..7b24792 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6VocabularyField; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 vocabulary-node type association to Drupal 8 migration. */ -class MigrateVocabularyEntityFormDisplayTest extends MigrateDrupalTestBase { +class MigrateVocabularyEntityFormDisplayTest extends MigrateDrupal6TestBase { /** * The modules to be enabled during the test. @@ -68,11 +69,9 @@ protected function setUp() { ); $this->prepareIdMappings($id_mappings); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_vocabulary_entity_form_display'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6VocabularyField.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6VocabularyField()); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyFieldInstanceTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyFieldInstanceTest.php index a569062..2285882 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyFieldInstanceTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyFieldInstanceTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6VocabularyField; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 vocabulary-node type association to Drupal 8 migration. */ -class MigrateVocabularyFieldInstanceTest extends MigrateDrupalTestBase { +class MigrateVocabularyFieldInstanceTest extends MigrateDrupal6TestBase { /** * The modules to be enabled during the test. @@ -67,11 +68,9 @@ protected function setUp() { 'type' => 'taxonomy_term_reference', ))->save(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_vocabulary_field_instance'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6VocabularyField.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6VocabularyField()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyFieldTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyFieldTest.php index df4781c..fa7117c 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyFieldTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateVocabularyFieldTest.php @@ -8,12 +8,13 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6VocabularyField; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Tests the Drupal 6 vocabulary-node type association to Drupal 8 migration. */ -class MigrateVocabularyFieldTest extends MigrateDrupalTestBase { +class MigrateVocabularyFieldTest extends MigrateDrupal6TestBase { /** * The modules to be enabled during the test. @@ -53,11 +54,9 @@ protected function setUp() { 'vid' => 'test_vocab', ))->save(); + /** @var \Drupal\migrate\Entity\Migration $migration */ $migration = entity_load('migration', 'd6_vocabulary_field'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6VocabularyField.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6VocabularyField()); $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/dependencies/MigrateDependenciesTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/dependencies/MigrateDependenciesTest.php index 32941fb..24c790c 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/dependencies/MigrateDependenciesTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/dependencies/MigrateDependenciesTest.php @@ -9,7 +9,8 @@ use Drupal\Component\Utility\String; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; +use Drupal\migrate_drupal\Tests\Dump\Drupal6AggregatorItem; +use Drupal\migrate_drupal\Tests\MigrateDrupal6TestBase; /** * Test the migrate dependencies @@ -17,8 +18,13 @@ * @group Drupal * @group migrate_drupal */ -class MigrateDependenciesTest extends MigrateDrupalTestBase { +class MigrateDependenciesTest extends MigrateDrupal6TestBase { + /** + * Modules + * + * @var string[] + */ static $modules = array('aggregator'); /** @@ -37,6 +43,7 @@ public static function getInfo() { */ public function testMigrateDependenciesOrder() { $migration_items = array('d6_comment', 'd6_filter_format', 'd6_node'); + /** @var \Drupal\migrate\Entity\Migration[] $migrations */ $migrations = entity_load_multiple('migration', $migration_items); $expected_order = array('d6_filter_format', 'd6_node', 'd6_comment'); $this->assertEqual(array_keys($migrations), $expected_order); @@ -56,10 +63,7 @@ public function testMigrateDependenciesOrder() { public function testAggregatorMigrateDependencies() { /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_aggregator_item'); - $dumps = array( - $this->getDumpDirectory() . '/Drupal6AggregatorItem.php', - ); - $this->prepare($migration, $dumps); + $this->loadDrupal6Dump(new Drupal6AggregatorItem()); $executable = new MigrateExecutable($migration, $this); $this->startCollectingMessages(); $executable->import(); -- 1.8.5.1 From 0d5e6673326f5a5b804fb5cb38da9424ce170aac Mon Sep 17 00:00:00 2001 From: Andreas Hennings Date: Mon, 5 May 2014 23:12:37 +0200 Subject: [PATCH 2/7] Rename getDbConnection() to getConnection() --- .../Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php | 2 +- .../migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php | 4 ++-- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6BookSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php | 4 ++-- .../Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6ContactSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DblogSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php | 6 +++--- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FileSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FilterFormat.php | 6 +++--- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ForumSettings.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6LocaleSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6MenuSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php | 6 +++--- .../Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php | 4 ++-- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeRevision.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php | 6 +++--- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6SearchSettings.php | 2 +- .../migrate_drupal/Tests/Dump/Drupal6SimpletestSettings.php | 2 +- .../migrate_drupal/Tests/Dump/Drupal6StatisticsSettings.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6SyslogSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFile.php | 2 +- .../migrate_drupal/Tests/Dump/Drupal6SystemFileStandalone.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFilter.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImage.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImageGd.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6SystemMaintenance.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemTheme.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomySettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php | 4 ++-- .../migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TextSettings.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6UpdateSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php | 8 ++++---- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserMail.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserRole.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php | 4 ++-- .../lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php | 2 +- 59 files changed, 75 insertions(+), 75 deletions(-) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php index 822f363..a0142e3 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php @@ -19,7 +19,7 @@ class Drupal6ActionSettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php index b218b58..1f5cd8c 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php @@ -99,7 +99,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { ), )); - $dbWrapper->getDbConnection()->insert('aggregator_feed')->fields(array( + $dbWrapper->getConnection()->insert('aggregator_feed')->fields(array( 'fid', 'title', 'url', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php index 9a2137d..9bc7753 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php @@ -75,7 +75,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'indexes' => array('fid' => array('fid')), )); - $dbWrapper->getDbConnection()->insert('aggregator_item')->fields(array( + $dbWrapper->getConnection()->insert('aggregator_item')->fields(array( 'iid', 'fid', 'title', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php index 59b045d..21f406b 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php @@ -19,7 +19,7 @@ class Drupal6AggregatorSettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php index 9c5a748..89af4ab 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php @@ -143,7 +143,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'module' => 'block', 'name' => 'blocks_roles', )); - $dbWrapper->getDbConnection()->insert('blocks')->fields(array( + $dbWrapper->getConnection()->insert('blocks')->fields(array( 'bid', 'module', 'delta', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php index 921cbb9..27dbdeb 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php @@ -240,7 +240,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'module' => 'system', 'name' => 'menu_links', )); - $dbWrapper->getDbConnection()->insert('book')->fields(array( + $dbWrapper->getConnection()->insert('book')->fields(array( 'mlid', 'nid', 'bid', @@ -271,7 +271,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'bid' => '8', )) ->execute(); - $dbWrapper->getDbConnection()->insert('menu_links')->fields(array( + $dbWrapper->getConnection()->insert('menu_links')->fields(array( 'menu_name', 'mlid', 'plid', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6BookSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6BookSettings.php index 5be62d9..7bc3cc3 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6BookSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6BookSettings.php @@ -19,7 +19,7 @@ class Drupal6BookSettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php index 12d6662..043cf98 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php @@ -49,7 +49,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'primary key' => array('bid'), )); - $dbWrapper->getDbConnection()->insert('boxes')->fields(array( + $dbWrapper->getConnection()->insert('boxes')->fields(array( 'bid', 'body', 'info', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php index ac0da78..dc1d500 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php @@ -115,7 +115,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { ), 'primary key' => array('cid'), )); - $dbWrapper->getDbConnection()->insert('comments')->fields(array( + $dbWrapper->getConnection()->insert('comments')->fields(array( 'cid', 'pid', 'nid', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php index cc627eb..ed32b78 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php @@ -109,7 +109,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'module' => 'node', 'name' => 'node_type', )); - $dbWrapper->getDbConnection()->insert('node_type')->fields(array( + $dbWrapper->getConnection()->insert('node_type')->fields(array( 'type', 'name', 'module', @@ -158,7 +158,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'orig_type' => 'story', )) ->execute(); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php index b2d1895..571173e 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php @@ -69,7 +69,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'list' => array('weight', 'category'), ), )); - $dbWrapper->getDbConnection()->insert('contact')->fields(array('cid', 'category', 'recipients', 'reply', 'weight', 'selected')) + $dbWrapper->getConnection()->insert('contact')->fields(array('cid', 'category', 'recipients', 'reply', 'weight', 'selected')) ->values(array( 'cid' => '1', 'category' => 'Website feedback', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactSettings.php index 3e75bcb..d257376 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactSettings.php @@ -19,7 +19,7 @@ class Drupal6ContactSettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php index fc0c6f0..c4a1cc1 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php @@ -14,7 +14,7 @@ class Drupal6DateFormat implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DblogSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DblogSettings.php index 1f4c3e3..9110c59 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DblogSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DblogSettings.php @@ -19,7 +19,7 @@ class Drupal6DblogSettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php index 7df5867..6f5133d 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php @@ -83,7 +83,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'primary key' => array('field_name', 'type_name'), )); - $dbWrapper->getDbConnection()->insert('content_node_field_instance')->fields(array( + $dbWrapper->getConnection()->insert('content_node_field_instance')->fields(array( 'field_name', 'type_name', 'weight', @@ -658,7 +658,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'primary key' => array('field_name'), )); - $dbWrapper->getDbConnection()->insert('content_node_field')->fields(array( + $dbWrapper->getConnection()->insert('content_node_field')->fields(array( 'field_name', 'module', 'type', @@ -826,7 +826,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { ), 'primary key' => array('vid', 'delta'), )); - $dbWrapper->getDbConnection()->insert('content_field_test_two')->fields(array( + $dbWrapper->getConnection()->insert('content_field_test_two')->fields(array( 'vid', 'nid', 'field_test_two_value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldSettings.php index d59a1b7..f25dcee 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldSettings.php @@ -19,7 +19,7 @@ class Drupal6FieldSettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php index ee97f38..ffee1c9 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php @@ -85,7 +85,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'module' => 'system', 'name' => 'files', )); - $dbWrapper->getDbConnection()->insert('files')->fields(array( + $dbWrapper->getConnection()->insert('files')->fields(array( 'fid', 'uid', 'filename', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FileSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FileSettings.php index 592f61c..2274183 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FileSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FileSettings.php @@ -19,7 +19,7 @@ class Drupal6FileSettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FilterFormat.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FilterFormat.php index 07da430..4dc2766 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FilterFormat.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FilterFormat.php @@ -98,7 +98,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'unique keys' => array('name' => array('name')), )); $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) @@ -119,7 +119,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'value' => 's:2:"72";', )) ->execute(); - $dbWrapper->getDbConnection()->insert('filter_formats')->fields(array( + $dbWrapper->getConnection()->insert('filter_formats')->fields(array( 'format', 'name', 'roles', @@ -145,7 +145,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { )) ->execute(); - $dbWrapper->getDbConnection()->insert('filters')->fields(array( + $dbWrapper->getConnection()->insert('filters')->fields(array( 'fid', 'format', 'module', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ForumSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ForumSettings.php index 6f5a435..c34cd79 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ForumSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ForumSettings.php @@ -19,7 +19,7 @@ class Drupal6ForumSettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6LocaleSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6LocaleSettings.php index 8d4c3c3..67728d0 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6LocaleSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6LocaleSettings.php @@ -19,7 +19,7 @@ class Drupal6LocaleSettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php index 9ff52a1..342725e 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php @@ -42,7 +42,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'module' => 'menu', 'name' => 'menu_custom', )); - $dbWrapper->getDbConnection()->insert('menu_custom')->fields(array('menu_name', 'title', 'description')) + $dbWrapper->getConnection()->insert('menu_custom')->fields(array('menu_name', 'title', 'description')) ->values(array( 'menu_name' => 'navigation', 'title' => 'Navigation', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6MenuSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6MenuSettings.php index bc02cc6..e43db74 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6MenuSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6MenuSettings.php @@ -20,7 +20,7 @@ class Drupal6MenuSettings implements DumpInterface { public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); $dbWrapper->setModuleVersion('menu', 6000); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php index ab1bc78..a6bb796 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php @@ -134,7 +134,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { ), 'primary key' => array('nid'), )); - $dbWrapper->getDbConnection()->insert('node')->fields(array( + $dbWrapper->getConnection()->insert('node')->fields(array( 'nid', 'vid', 'type', @@ -253,7 +253,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'primary key' => array('vid'), )); - $dbWrapper->getDbConnection()->insert('node_revisions')->fields( + $dbWrapper->getConnection()->insert('node_revisions')->fields( array( 'nid', 'vid', @@ -316,7 +316,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'primary key' => array('vid'), )); - $dbWrapper->getDbConnection()->insert('content_type_story')->fields( + $dbWrapper->getConnection()->insert('content_type_story')->fields( array( 'nid', 'vid', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php index d32340a..24a2f2e 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php @@ -20,7 +20,7 @@ class Drupal6NodeBodyInstance implements DumpInterface { public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); $dbWrapper->createTable('node_type'); - $dbWrapper->getDbConnection()->insert('node_type')->fields(array( + $dbWrapper->getConnection()->insert('node_type')->fields(array( 'type', 'name', 'module', @@ -85,7 +85,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'orig_type' => '', )) ->execute(); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeRevision.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeRevision.php index abb7d7a..4ffdbfa 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeRevision.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeRevision.php @@ -16,7 +16,7 @@ class Drupal6NodeRevision implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->getDbConnection()->insert('node_revisions')->fields( + $dbWrapper->getConnection()->insert('node_revisions')->fields( array( 'nid', 'vid', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeSettings.php index ebd401a..24d5ac0 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeSettings.php @@ -19,7 +19,7 @@ class Drupal6NodeSettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php index 49c4521..e6b0048 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php @@ -19,7 +19,7 @@ class Drupal6NodeType implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('node_type'); - $dbWrapper->getDbConnection()->insert('node_type')->fields( + $dbWrapper->getConnection()->insert('node_type')->fields( array( 'type', 'name', @@ -70,7 +70,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { )) ->execute(); - $dbWrapper->getDbConnection()->merge('node_type') + $dbWrapper->getConnection()->merge('node_type') ->key(array('type' => 'story')) ->fields(array( 'name' => 'Story', @@ -90,7 +90,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { ->execute(); $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php index d520e97..6c29e17 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php @@ -20,7 +20,7 @@ class Drupal6SearchPage implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchSettings.php index 1ba5511..413eb6d 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchSettings.php @@ -19,7 +19,7 @@ class Drupal6SearchSettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SimpletestSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SimpletestSettings.php index bb6100f..d3b55b2 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SimpletestSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SimpletestSettings.php @@ -19,7 +19,7 @@ class Drupal6SimpletestSettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6StatisticsSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6StatisticsSettings.php index 78c2909..bbc9270 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6StatisticsSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6StatisticsSettings.php @@ -19,7 +19,7 @@ class Drupal6StatisticsSettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SyslogSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SyslogSettings.php index c50b3be..ad4c1de 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SyslogSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SyslogSettings.php @@ -19,7 +19,7 @@ class Drupal6SyslogSettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php index e9414d5..0783e47 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php @@ -19,7 +19,7 @@ class Drupal6SystemCron implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFile.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFile.php index 8ca7cbb..2ab7a96 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFile.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFile.php @@ -19,7 +19,7 @@ class Drupal6SystemFile implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFileStandalone.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFileStandalone.php index b0432c3..cc24f64 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFileStandalone.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFileStandalone.php @@ -23,7 +23,7 @@ class Drupal6SystemFileStandalone implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFilter.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFilter.php index 7631aa0..f00616a 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFilter.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFilter.php @@ -19,7 +19,7 @@ class Drupal6SystemFilter implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImage.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImage.php index 5453eca..4b308a7 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImage.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImage.php @@ -19,7 +19,7 @@ class Drupal6SystemImage implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImageGd.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImageGd.php index 72a7d37..6b34474 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImageGd.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImageGd.php @@ -19,7 +19,7 @@ class Drupal6SystemImageGd implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemMaintenance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemMaintenance.php index 7a1b1f8..f2557b9 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemMaintenance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemMaintenance.php @@ -19,7 +19,7 @@ class Drupal6SystemMaintenance implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php index 5c91e7c..d2e880b 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php @@ -19,7 +19,7 @@ class Drupal6SystemPerformance implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php index 87181d5..7834e92 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php @@ -19,7 +19,7 @@ class Drupal6SystemRss implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php index bdb32a9..0f1e4b7 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php @@ -19,7 +19,7 @@ class Drupal6SystemSite implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemTheme.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemTheme.php index 7dac9a7..8c56a4a 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemTheme.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemTheme.php @@ -19,7 +19,7 @@ class Drupal6SystemTheme implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomySettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomySettings.php index aa83bd1..db6b026 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomySettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomySettings.php @@ -19,7 +19,7 @@ class Drupal6TaxonomySettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php index 1d807af..5043ef3 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php @@ -96,7 +96,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'name' => 'term_hierarchy', )); - $dbWrapper->getDbConnection()->insert('term_data')->fields(array( + $dbWrapper->getConnection()->insert('term_data')->fields(array( 'tid', 'vid', 'name', @@ -147,7 +147,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { )) ->execute(); - $dbWrapper->getDbConnection()->insert('term_hierarchy')->fields(array( + $dbWrapper->getConnection()->insert('term_hierarchy')->fields(array( 'tid', 'parent', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php index 150404d..5b11730 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php @@ -130,7 +130,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'vid' => array('vid'), ), )); - $dbWrapper->getDbConnection()->insert('vocabulary')->fields(array( + $dbWrapper->getConnection()->insert('vocabulary')->fields(array( 'vid', 'name', 'description', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php index 96581ff..7b364ab 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php @@ -54,7 +54,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'module' => 'taxonomy', 'name' => 'term_node', )); - $dbWrapper->getDbConnection()->insert('term_node')->fields(array( + $dbWrapper->getConnection()->insert('term_node')->fields(array( 'nid', 'vid', 'tid', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TextSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TextSettings.php index 9b4029b..7813078 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TextSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TextSettings.php @@ -20,7 +20,7 @@ class Drupal6TextSettings implements DumpInterface { public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); // This needs to be a merge to avoid conflicts with Drupal6NodeBodyInstance. - $dbWrapper->getDbConnection()->merge('variable') + $dbWrapper->getConnection()->merge('variable') ->key(array('name' => 'teaser_length')) ->fields(array('value' => 'i:456;')) ->execute(); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UpdateSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UpdateSettings.php index 57a6ee0..c0f8f33 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UpdateSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UpdateSettings.php @@ -19,7 +19,7 @@ class Drupal6UpdateSettings implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php index cbf2deb..588236a 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php @@ -68,7 +68,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'nid' => array('nid'), ), )); - $dbWrapper->getDbConnection()->insert('upload')->fields(array( + $dbWrapper->getConnection()->insert('upload')->fields(array( 'nid', 'vid', 'fid', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php index 2aa4170..8af3fb7 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php @@ -20,7 +20,7 @@ class Drupal6UploadInstance implements DumpInterface { public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->setModuleVersion('upload', 6000); $dbWrapper->createTable('node_type'); - $dbWrapper->getDbConnection()->merge('node_type') + $dbWrapper->getConnection()->merge('node_type') ->key(array('type' => 'page')) ->fields(array( 'name' => 'Page', @@ -38,7 +38,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'orig_type' => 'page', )) ->execute(); - $dbWrapper->getDbConnection()->merge('node_type') + $dbWrapper->getConnection()->merge('node_type') ->key(array('type' => 'story')) ->fields(array( 'name' => 'Story', @@ -56,7 +56,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'orig_type' => 'story', )) ->execute(); - $dbWrapper->getDbConnection()->merge('node_type') + $dbWrapper->getConnection()->merge('node_type') ->key(array('type' => 'article')) ->fields(array( 'name' => 'Article', @@ -75,7 +75,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { )) ->execute(); $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php index 9d71e3a..318165e 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php @@ -59,7 +59,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'indexes' => array('src_language_pid' => array('src', 'language', 'pid')), )); - $dbWrapper->getDbConnection()->insert('url_alias')->fields(array( + $dbWrapper->getConnection()->insert('url_alias')->fields(array( 'pid', 'src', 'dst', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php index 4561e7e..67f31dc 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php @@ -26,7 +26,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { // Insert data. $data = static::getData($table); if ($data) { - $query = $dbWrapper->getDbConnection()->insert($table)->fields(array_keys($data[0])); + $query = $dbWrapper->getConnection()->insert($table)->fields(array_keys($data[0])); foreach ($data as $record) { $query->values($record); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserMail.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserMail.php index 55bba9c..7b217ce 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserMail.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserMail.php @@ -19,7 +19,7 @@ class Drupal6UserMail implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->createTable('variable'); - $dbWrapper->getDbConnection()->insert('variable')->fields(array( + $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php index 1061a21..8028ad0 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php @@ -109,7 +109,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { // Insert data. $data = static::getData('profile_fields'); if ($data) { - $query = $dbWrapper->getDbConnection()->insert('profile_fields')->fields(array_keys($data[0])); + $query = $dbWrapper->getConnection()->insert('profile_fields')->fields(array_keys($data[0])); foreach ($data as $record) { $query->values($record); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserRole.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserRole.php index 5474dc6..4d9b674 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserRole.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserRole.php @@ -25,7 +25,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { // Insert data. $data = static::getData($table); if ($data) { - $query = $dbWrapper->getDbConnection()->insert($table)->fields(array_keys($data[0])); + $query = $dbWrapper->getConnection()->insert($table)->fields(array_keys($data[0])); foreach ($data as $record) { $query->values($record); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php index 9764d80..1e89dc4 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php @@ -103,7 +103,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'name' => 'vocabulary', )); - $dbWrapper->getDbConnection()->insert('vocabulary') + $dbWrapper->getConnection()->insert('vocabulary') ->fields(array( 'vid' => 4, 'name' => 'Tags', @@ -144,7 +144,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { ), )); - $dbWrapper->getDbConnection()->insert('vocabulary_node_types')->fields(array( + $dbWrapper->getConnection()->insert('vocabulary_node_types')->fields(array( 'vid', 'type', )) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php index cd47790..2b4501f 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php @@ -43,7 +43,7 @@ public function __construct(Connection $database) { * @return \Drupal\Core\Database\Connection * The database connection for the Drupal 6 database. */ - public function getDbConnection() { + public function getConnection() { return $this->database; } -- 1.8.5.1 From c72d34fae775a522557704111592d94e483e65bb Mon Sep 17 00:00:00 2001 From: Andreas Hennings Date: Mon, 5 May 2014 23:16:03 +0200 Subject: [PATCH 3/7] Rename 'database' property and parameter to 'connection'. --- .../Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php index 2b4501f..b94d0be 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php @@ -18,7 +18,7 @@ class Drupal6DbWrapper { * * @var \Drupal\Core\Database\Connection */ - protected $database; + protected $connection; /** * An array to keep track of tables already created. @@ -30,11 +30,11 @@ class Drupal6DbWrapper { /** * Sample database schema and values. * - * @param \Drupal\Core\Database\Connection $database + * @param \Drupal\Core\Database\Connection $connection * The database connection for the Drupal 6 database. */ - public function __construct(Connection $database) { - $this->database = $database; + public function __construct(Connection $connection) { + $this->connection = $connection; } /** @@ -44,7 +44,7 @@ public function __construct(Connection $database) { * The database connection for the Drupal 6 database. */ public function getConnection() { - return $this->database; + return $this->connection; } /** @@ -66,7 +66,7 @@ public function createTable($name, $table = NULL) { $table = $this->getTableDefinition($name); } $this->migrateTables[$name] = TRUE; - $this->database->schema()->createTable($name, $table); + $this->connection->schema()->createTable($name, $table); } /** @@ -279,7 +279,7 @@ protected function tableDefinitions() { */ public function setModuleVersion($module, $version, $status = 1) { $this->createTable('system'); - $this->database->merge('system') + $this->connection->merge('system') ->key(array('filename' => "modules/$module")) ->fields(array( 'type' => 'module', -- 1.8.5.1 From 05a87f16a9695b752d82ac6ebceb5c8990578b11 Mon Sep 17 00:00:00 2001 From: Andreas Hennings Date: Mon, 5 May 2014 23:15:06 +0200 Subject: [PATCH 4/7] Change the way that createTable() works, using schema()->tableExists() instead of the migrateTables variable. --- .../migrate_drupal/Tests/d6/Drupal6DbWrapper.php | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php index b94d0be..e5e376e 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php @@ -7,6 +7,7 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\Core\Database\Connection; +use Drupal\Core\Database\SchemaObjectExistsException; /** * Wrapper for a (temporary) Drupal 6 database. @@ -21,13 +22,6 @@ class Drupal6DbWrapper { protected $connection; /** - * An array to keep track of tables already created. - * - * @var true[] - */ - protected $migrateTables; - - /** * Sample database schema and values. * * @param \Drupal\Core\Database\Connection $connection @@ -56,17 +50,25 @@ public function getConnection() { * A Schema API table definition array, or * NULL, for a table with a known schema. * - * @throws \Exception + * @return bool + * TRUE, if the table was created or it already exists. */ public function createTable($name, $table = NULL) { - if (!empty($this->migrateTables[$name])) { - return; + if ($this->connection->schema()->tableExists($name)) { + // The table already exists. + return TRUE; } if (NULL === $table) { $table = $this->getTableDefinition($name); } - $this->migrateTables[$name] = TRUE; - $this->connection->schema()->createTable($name, $table); + try { + $this->connection->schema()->createTable($name, $table); + return TRUE; + } + catch (SchemaObjectExistsException $e) { + // The table was just created in another process. + return TRUE; + } } /** -- 1.8.5.1 From a0bfdcb493492b3c82a69ee0ea69bd3a67b2676a Mon Sep 17 00:00:00 2001 From: Andreas Hennings Date: Mon, 5 May 2014 23:17:02 +0200 Subject: [PATCH 5/7] Rename createTable() to ensureTable() --- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php | 4 ++-- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php | 4 ++-- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6BookSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php | 4 ++-- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DblogSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php | 6 +++--- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FileSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FilterFormat.php | 6 +++--- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ForumSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6LocaleSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6MenuSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php | 6 +++--- .../Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php | 4 ++-- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php | 4 ++-- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchSettings.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6SimpletestSettings.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6StatisticsSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SyslogSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFile.php | 2 +- .../migrate_drupal/Tests/Dump/Drupal6SystemFileStandalone.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFilter.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImage.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImageGd.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6SystemMaintenance.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemTheme.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomySettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php | 4 ++-- .../Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php | 4 ++-- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TextSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UpdateSettings.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php | 4 ++-- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserMail.php | 2 +- .../Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserRole.php | 2 +- .../lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php | 4 ++-- .../lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php | 4 ++-- 58 files changed, 74 insertions(+), 74 deletions(-) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php index a0142e3..f377ea9 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php @@ -18,7 +18,7 @@ class Drupal6ActionSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php index 1f5cd8c..13d4148 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php @@ -18,7 +18,7 @@ class Drupal6AggregatorFeed implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('aggregator_feed', array( + $dbWrapper->ensureTable('aggregator_feed', array( 'description' => 'Stores feeds to be parsed by the aggregator.', 'fields' => array( 'fid' => array( diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php index 9bc7753..564b351 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php @@ -18,7 +18,7 @@ class Drupal6AggregatorItem implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('aggregator_item', array( + $dbWrapper->ensureTable('aggregator_item', array( 'description' => 'Stores the individual items imported from feeds.', 'fields' => array( 'iid' => array( diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php index 21f406b..3e40b75 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php @@ -18,7 +18,7 @@ class Drupal6AggregatorSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php index 89af4ab..9d3e905 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php @@ -15,7 +15,7 @@ class Drupal6Block implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('blocks', array( + $dbWrapper->ensureTable('blocks', array( 'fields' => array( 'bid' => array( 'type' => 'serial', @@ -112,7 +112,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { ), ), )); - $dbWrapper->createTable('blocks_roles', array( + $dbWrapper->ensureTable('blocks_roles', array( 'fields' => array( 'module' => array( 'type' => 'varchar', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php index 27dbdeb..74579d4 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php @@ -15,7 +15,7 @@ class Drupal6Book implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('book', array( + $dbWrapper->ensureTable('book', array( 'fields' => array( 'mlid' => array( 'type' => 'int', @@ -52,7 +52,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'module' => 'book', 'name' => 'book', )); - $dbWrapper->createTable('menu_links', array( + $dbWrapper->ensureTable('menu_links', array( 'fields' => array( 'menu_name' => array( 'type' => 'varchar', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6BookSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6BookSettings.php index 7bc3cc3..acbead2 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6BookSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6BookSettings.php @@ -18,7 +18,7 @@ class Drupal6BookSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php index 043cf98..39e7297 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php @@ -15,7 +15,7 @@ class Drupal6Box implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('boxes', array( + $dbWrapper->ensureTable('boxes', array( 'description' => 'Stores contents of custom-made blocks.', 'fields' => array( 'bid' => array( diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php index dc1d500..2a4b0de 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php @@ -15,7 +15,7 @@ class Drupal6Comment implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('comments', array( + $dbWrapper->ensureTable('comments', array( 'description' => 'Stores comments and associated data.', 'fields' => array( 'cid' => array( diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php index ed32b78..afa357e 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php @@ -19,8 +19,8 @@ class Drupal6CommentVariable implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); - $dbWrapper->createTable('node_type', array( + $dbWrapper->ensureTable('variable'); + $dbWrapper->ensureTable('node_type', array( 'fields' => array( 'type' => array( 'type' => 'varchar', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php index 571173e..87463e1 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php @@ -18,7 +18,7 @@ class Drupal6ContactCategory implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('contact', array( + $dbWrapper->ensureTable('contact', array( 'description' => 'Contact form category settings.', 'fields' => array( 'cid' => array( diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactSettings.php index d257376..5347c2a 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactSettings.php @@ -18,7 +18,7 @@ class Drupal6ContactSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php index c4a1cc1..998bc83 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php @@ -13,7 +13,7 @@ class Drupal6DateFormat implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DblogSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DblogSettings.php index 9110c59..f04d7a6 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DblogSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DblogSettings.php @@ -18,7 +18,7 @@ class Drupal6DblogSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php index 6f5133d..08008e7 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php @@ -18,7 +18,7 @@ class Drupal6FieldInstance implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('content_node_field_instance', array( + $dbWrapper->ensureTable('content_node_field_instance', array( 'description' => 'Table that contains field instance settings.', 'fields' => array( 'field_name' => array( @@ -591,7 +591,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { ->execute(); // Create the field table. - $dbWrapper->createTable('content_node_field', array( + $dbWrapper->ensureTable('content_node_field', array( 'description' => 'Table that contains field instance settings.', 'fields' => array( 'field_name' => array( @@ -788,7 +788,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { )) ->execute(); - $dbWrapper->createTable('content_field_test_two', array( + $dbWrapper->ensureTable('content_field_test_two', array( 'description' => 'Table for field_test_two', 'fields' => array( 'vid' => array( diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldSettings.php index f25dcee..60e5eca 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldSettings.php @@ -18,7 +18,7 @@ class Drupal6FieldSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php index ffee1c9..3ee6e44 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php @@ -19,7 +19,7 @@ class Drupal6File implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('files', array( + $dbWrapper->ensureTable('files', array( 'fields' => array( 'fid' => array( 'type' => 'serial', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FileSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FileSettings.php index 2274183..b3e8213 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FileSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FileSettings.php @@ -18,7 +18,7 @@ class Drupal6FileSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FilterFormat.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FilterFormat.php index 4dc2766..a4462e2 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FilterFormat.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FilterFormat.php @@ -19,7 +19,7 @@ class Drupal6FilterFormat implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('filters', array( + $dbWrapper->ensureTable('filters', array( 'description' => 'Table that maps filters (HTML corrector) to input formats (Filtered HTML).', 'fields' => array( 'fid' => array( @@ -63,7 +63,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'list' => array('format', 'weight', 'module', 'delta'), ), )); - $dbWrapper->createTable('filter_formats', array( + $dbWrapper->ensureTable('filter_formats', array( 'description' => 'Stores input formats: custom groupings of filters, such as Filtered HTML.', 'fields' => array( 'format' => array( @@ -97,7 +97,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'primary key' => array('format'), 'unique keys' => array('name' => array('name')), )); - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ForumSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ForumSettings.php index c34cd79..468d45a 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ForumSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ForumSettings.php @@ -18,7 +18,7 @@ class Drupal6ForumSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6LocaleSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6LocaleSettings.php index 67728d0..3bc6787 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6LocaleSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6LocaleSettings.php @@ -18,7 +18,7 @@ class Drupal6LocaleSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php index 342725e..5ee1e5f 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php @@ -17,7 +17,7 @@ class Drupal6Menu implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('menu_custom', array( + $dbWrapper->ensureTable('menu_custom', array( 'fields' => array( 'menu_name' => array( 'type' => 'varchar', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6MenuSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6MenuSettings.php index e43db74..a9cec0d 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6MenuSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6MenuSettings.php @@ -18,7 +18,7 @@ class Drupal6MenuSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->setModuleVersion('menu', 6000); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php index a6bb796..fc7b0d4 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php @@ -18,7 +18,7 @@ class Drupal6Node implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('node', array( + $dbWrapper->ensureTable('node', array( 'description' => 'The base table for nodes.', 'fields' => array( 'nid' => array( @@ -186,7 +186,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'translate' => 0, )) ->execute(); - $dbWrapper->createTable('node_revisions', array( + $dbWrapper->ensureTable('node_revisions', array( 'description' => 'Stores information about each saved version of a {node}.', 'fields' => array( 'nid' => array( @@ -289,7 +289,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { )) ->execute(); - $dbWrapper->createTable('content_type_story', array( + $dbWrapper->ensureTable('content_type_story', array( 'description' => 'The content type join table.', 'fields' => array( 'nid' => array( diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php index 24a2f2e..eea3218 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php @@ -18,8 +18,8 @@ class Drupal6NodeBodyInstance implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); - $dbWrapper->createTable('node_type'); + $dbWrapper->ensureTable('variable'); + $dbWrapper->ensureTable('node_type'); $dbWrapper->getConnection()->insert('node_type')->fields(array( 'type', 'name', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeSettings.php index 24d5ac0..a4d26b8 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeSettings.php @@ -18,7 +18,7 @@ class Drupal6NodeSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php index e6b0048..e1620f2 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php @@ -18,7 +18,7 @@ class Drupal6NodeType implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('node_type'); + $dbWrapper->ensureTable('node_type'); $dbWrapper->getConnection()->insert('node_type')->fields( array( 'type', @@ -89,7 +89,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { )) ->execute(); - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php index 6c29e17..df7458f 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php @@ -19,7 +19,7 @@ class Drupal6SearchPage implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchSettings.php index 413eb6d..8aa632e 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchSettings.php @@ -18,7 +18,7 @@ class Drupal6SearchSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SimpletestSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SimpletestSettings.php index d3b55b2..422249e 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SimpletestSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SimpletestSettings.php @@ -18,7 +18,7 @@ class Drupal6SimpletestSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6StatisticsSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6StatisticsSettings.php index bbc9270..b49e389 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6StatisticsSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6StatisticsSettings.php @@ -18,7 +18,7 @@ class Drupal6StatisticsSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SyslogSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SyslogSettings.php index ad4c1de..1d523de 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SyslogSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SyslogSettings.php @@ -18,7 +18,7 @@ class Drupal6SyslogSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php index 0783e47..abb78f9 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php @@ -18,7 +18,7 @@ class Drupal6SystemCron implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFile.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFile.php index 2ab7a96..079e2c6 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFile.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFile.php @@ -18,7 +18,7 @@ class Drupal6SystemFile implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFileStandalone.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFileStandalone.php index cc24f64..1a8397f 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFileStandalone.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFileStandalone.php @@ -22,7 +22,7 @@ class Drupal6SystemFileStandalone implements DumpInterface { * @throws \Exception */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFilter.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFilter.php index f00616a..3c3f0c4 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFilter.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFilter.php @@ -18,7 +18,7 @@ class Drupal6SystemFilter implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImage.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImage.php index 4b308a7..f176a4a 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImage.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImage.php @@ -18,7 +18,7 @@ class Drupal6SystemImage implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImageGd.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImageGd.php index 6b34474..3563e06 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImageGd.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImageGd.php @@ -18,7 +18,7 @@ class Drupal6SystemImageGd implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemMaintenance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemMaintenance.php index f2557b9..7f2c78b 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemMaintenance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemMaintenance.php @@ -18,7 +18,7 @@ class Drupal6SystemMaintenance implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php index d2e880b..4847780 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php @@ -18,7 +18,7 @@ class Drupal6SystemPerformance implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php index 7834e92..0a232e9 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php @@ -18,7 +18,7 @@ class Drupal6SystemRss implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php index 0f1e4b7..8c406ec 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php @@ -18,7 +18,7 @@ class Drupal6SystemSite implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemTheme.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemTheme.php index 8c56a4a..1c54ecf 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemTheme.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemTheme.php @@ -18,7 +18,7 @@ class Drupal6SystemTheme implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomySettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomySettings.php index db6b026..d1a8a02 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomySettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomySettings.php @@ -18,7 +18,7 @@ class Drupal6TaxonomySettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php index 5043ef3..5fdff55 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php @@ -19,7 +19,7 @@ class Drupal6TaxonomyTerm implements DumpInterface { public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->setModuleVersion('taxonomy', 6000); - $dbWrapper->createTable('term_data', array( + $dbWrapper->ensureTable('term_data', array( 'fields' => array( 'tid' => array( 'type' => 'serial', @@ -68,7 +68,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'name' => 'term_data', )); - $dbWrapper->createTable('term_hierarchy', array( + $dbWrapper->ensureTable('term_hierarchy', array( 'fields' => array( 'tid' => array( 'type' => 'int', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php index 5b11730..ae0c686 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php @@ -18,7 +18,7 @@ class Drupal6TaxonomyVocabulary implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('vocabulary', array( + $dbWrapper->ensureTable('vocabulary', array( 'description' => 'Stores vocabulary information.', 'fields' => array( 'vid' => array( @@ -107,7 +107,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'list' => array('weight', 'name'), ), )); - $dbWrapper->createTable('vocabulary_node_types', array( + $dbWrapper->ensureTable('vocabulary_node_types', array( 'description' => 'Stores which node types vocabularies may be used with.', 'fields' => array( 'vid' => array( diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php index 7b364ab..adb2b13 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php @@ -18,7 +18,7 @@ class Drupal6TermNode implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->setModuleVersion('taxonomy', 6000); - $dbWrapper->createTable('term_node', array( + $dbWrapper->ensureTable('term_node', array( 'fields' => array( 'nid' => array( 'type' => 'int', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TextSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TextSettings.php index 7813078..388c798 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TextSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TextSettings.php @@ -18,7 +18,7 @@ class Drupal6TextSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); // This needs to be a merge to avoid conflicts with Drupal6NodeBodyInstance. $dbWrapper->getConnection()->merge('variable') ->key(array('name' => 'teaser_length')) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UpdateSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UpdateSettings.php index c0f8f33..9f3fc05 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UpdateSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UpdateSettings.php @@ -18,7 +18,7 @@ class Drupal6UpdateSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php index 588236a..d5c58f6 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php @@ -16,7 +16,7 @@ class Drupal6Upload implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->setModuleVersion('upload', 6000); - $dbWrapper->createTable('upload', array( + $dbWrapper->ensureTable('upload', array( 'fields' => array( 'fid' => array( 'type' => 'int', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php index 8af3fb7..6596934 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php @@ -19,7 +19,7 @@ class Drupal6UploadInstance implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { $dbWrapper->setModuleVersion('upload', 6000); - $dbWrapper->createTable('node_type'); + $dbWrapper->ensureTable('node_type'); $dbWrapper->getConnection()->merge('node_type') ->key(array('type' => 'page')) ->fields(array( @@ -74,7 +74,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { 'orig_type' => 'story', )) ->execute(); - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php index 318165e..754e3df 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php @@ -17,7 +17,7 @@ class Drupal6UrlAlias implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('url_alias', array( + $dbWrapper->ensureTable('url_alias', array( 'description' => 'A list of URL aliases for Drupal paths; a user may visit either the source or destination path.', 'fields' => array( 'pid' => array( diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php index 67f31dc..fe0565e 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php @@ -21,7 +21,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { foreach (static::getSchema() as $table => $schema) { // Create tables. - $dbWrapper->createTable($table, $schema); + $dbWrapper->ensureTable($table, $schema); // Insert data. $data = static::getData($table); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserMail.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserMail.php index 7b217ce..f473b85 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserMail.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserMail.php @@ -18,7 +18,7 @@ class Drupal6UserMail implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('variable'); + $dbWrapper->ensureTable('variable'); $dbWrapper->getConnection()->insert('variable')->fields(array( 'name', 'value', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php index 8028ad0..72609b9 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php @@ -18,7 +18,7 @@ class Drupal6UserProfileFields implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('profile_fields', array( + $dbWrapper->ensureTable('profile_fields', array( 'fields' => array( 'fid' => array( 'type' => 'serial', diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserRole.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserRole.php index 4d9b674..7eec8ab 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserRole.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserRole.php @@ -20,7 +20,7 @@ class Drupal6UserRole implements DumpInterface { public function load(Drupal6DbWrapper $dbWrapper) { foreach (static::getSchema() as $table => $schema) { // Create tables. - $dbWrapper->createTable($table, $schema); + $dbWrapper->ensureTable($table, $schema); // Insert data. $data = static::getData($table); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php index 1e89dc4..ebbe050 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php @@ -18,7 +18,7 @@ class Drupal6VocabularyField implements DumpInterface { */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->createTable('vocabulary', array( + $dbWrapper->ensureTable('vocabulary', array( 'fields' => array( 'vid' => array( 'type' => 'serial', @@ -120,7 +120,7 @@ public function load(Drupal6DbWrapper $dbWrapper) { ->execute(); - $dbWrapper->createTable('vocabulary_node_types', array( + $dbWrapper->ensureTable('vocabulary_node_types', array( 'description' => 'Stores which node types vocabularies may be used with.', 'fields' => array( 'vid' => array( diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php index e5e376e..2252a81 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php @@ -53,7 +53,7 @@ public function getConnection() { * @return bool * TRUE, if the table was created or it already exists. */ - public function createTable($name, $table = NULL) { + public function ensureTable($name, $table = NULL) { if ($this->connection->schema()->tableExists($name)) { // The table already exists. return TRUE; @@ -280,7 +280,7 @@ protected function tableDefinitions() { * @param int $status */ public function setModuleVersion($module, $version, $status = 1) { - $this->createTable('system'); + $this->ensureTable('system'); $this->connection->merge('system') ->key(array('filename' => "modules/$module")) ->fields(array( -- 1.8.5.1 From 33aec92b7e5d1c37a7b0c78225766adc76fc928b Mon Sep 17 00:00:00 2001 From: Andreas Hennings Date: Mon, 5 May 2014 23:31:06 +0200 Subject: [PATCH 6/7] Introduce variableSet() and variableSetMultiple() --- .../migrate_drupal/Tests/d6/Drupal6DbWrapper.php | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php index 2252a81..b5c2dd7 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/Drupal6DbWrapper.php @@ -72,6 +72,45 @@ public function ensureTable($name, $table = NULL) { } /** + * Sets a system variable in the Drupal 6 database. + * + * Equivalent for Drupal 6 variable_set(). + * + * @param string $name + * The variable name. + * @param mixed $value + * The variable value. + */ + public function variableSet($name, $value) { + $this->ensureTable('variable'); + $this->connection->insert('variable') + ->fields(array( + 'name', + 'value', + )) + ->values(array( + 'name' => $name, + 'value' => serialize($value), + )) + ->execute(); + } + + /** + * Sets multiple system variables in the Drupal 6 database. + * + * @param mixed[] $values + * An associative array of variable names and values. + */ + public function variableSetMultiple(array $values) { + $this->ensureTable('variable'); + $insert = $this->connection->insert('variable')->fields(array('name', 'value')); + foreach ($values as $name => $value) { + $insert->values(array('name' => $name, 'value' => serialize($value))); + } + $insert->execute(); + } + + /** * @param string $name * The name of the table to create. This must be one of the "known" table * names, see tableDefinitions() below. -- 1.8.5.1 From 3a3083e24b8c7c646017280c9c2b878b00d99af0 Mon Sep 17 00:00:00 2001 From: Andreas Hennings Date: Tue, 6 May 2014 01:05:21 +0200 Subject: [PATCH 7/7] Use variableSetMultiple() for some dumps. --- .../Tests/Dump/Drupal6ActionSettings.php | 11 +-- .../Tests/Dump/Drupal6AggregatorSettings.php | 48 +++-------- .../Tests/Dump/Drupal6BookSettings.php | 23 ++--- .../Tests/Dump/Drupal6CommentVariable.php | 98 +++++----------------- .../Tests/Dump/Drupal6ContactSettings.php | 18 +--- .../Tests/Dump/Drupal6DateFormat.php | 23 ++--- .../Tests/Dump/Drupal6DblogSettings.php | 11 +-- .../Tests/Dump/Drupal6FieldSettings.php | 11 +-- .../Tests/Dump/Drupal6FileSettings.php | 23 ++--- .../Tests/Dump/Drupal6FilterFormat.php | 28 ++----- .../Tests/Dump/Drupal6ForumSettings.php | 40 ++------- .../Tests/Dump/Drupal6UploadInstance.php | 23 ++--- 12 files changed, 71 insertions(+), 286 deletions(-) diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php index f377ea9..170ac5a 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php @@ -18,16 +18,7 @@ class Drupal6ActionSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->ensureTable('variable'); - $dbWrapper->getConnection()->insert('variable')->fields(array( - 'name', - 'value', - )) - ->values(array( - 'name' => 'actions_max_stack', - 'value' => 'i:35;', - )) - ->execute(); + $dbWrapper->variableSet('actions_max_stack', 35); } } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php index 3e40b75..95c80da 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php @@ -18,43 +18,15 @@ class Drupal6AggregatorSettings implements DumpInterface { * {@inheritdoc} */ public function load(Drupal6DbWrapper $dbWrapper) { - $dbWrapper->ensureTable('variable'); - $dbWrapper->getConnection()->insert('variable')->fields(array( - 'name', - 'value', - )) - ->values(array( - 'name' => 'aggregator_fetcher', - 'value' => 's:10:"aggregator";', - )) - ->values(array( - 'name' => 'aggregator_parser', - 'value' => 's:10:"aggregator";', - )) - ->values(array( - 'name' => 'aggregator_processors', - 'value' => 'a:1:{i:0;s:10:"aggregator";}', - )) - ->values(array( - 'name' => 'aggregator_allowed_html_tags', - 'value' => 's:70:"