Commit b803cd32 authored by webchick's avatar webchick
Browse files

Issue #2248149 by jessebeach, donquixote, sun: Use __DIR__ instead of...

Issue #2248149 by jessebeach, donquixote, sun: Use __DIR__ instead of drupal_get_path() for local PSR-0/PSR-4 directories.
parent 6592304c
......@@ -17,4 +17,15 @@ class MigrateDrupalTestBase extends MigrateTestBase {
* @var array
*/
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';
}
}
......@@ -40,7 +40,7 @@ public function setUp() {
parent::setUp();
$migration = entity_load('migration', 'd6_action_settings');
$dumps = array(
dirname(__DIR__) . '/Dump/Drupal6ActionSettings.php',
$this->getDumpDirectory() . '/Drupal6ActionSettings.php',
);
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, $this);
......
......@@ -40,7 +40,7 @@ public function setUp() {
parent::setUp();
$migration = entity_load('migration', 'd6_aggregator_settings');
$dumps = array(
dirname(__DIR__) . '/Dump/Drupal6AggregatorSettings.php',
$this->getDumpDirectory() . '/Drupal6AggregatorSettings.php',
);
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, $this);
......
......@@ -34,7 +34,7 @@ public function setUp() {
parent::setUp();
$migration = entity_load('migration', 'd6_aggregator_feed');
$dumps = array(
drupal_get_path('module', 'migrate_drupal') . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php',
$this->getDumpDirectory() . '/Drupal6AggregatorFeed.php',
);
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, $this);
......
......@@ -55,9 +55,8 @@ public function setUp() {
$entity->save();
/** @var \Drupal\migrate\entity\Migration $migration */
$migration = entity_load('migration', 'd6_aggregator_item');
$path = drupal_get_path('module', 'migrate_drupal');
$dumps = array(
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php',
$this->getDumpDirectory() . '/Drupal6AggregatorItem.php',
);
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, $this);
......
......@@ -58,7 +58,7 @@ public function setUp() {
/** @var \Drupal\migrate\entity\Migration $migration */
$migration = entity_load('migration', 'd6_block');
$dumps = array(
drupal_get_path('module', 'migrate_drupal') . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php',
$this->getDumpDirectory() . '/Drupal6Block.php',
);
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, $this);
......
......@@ -41,7 +41,7 @@ public function setUp() {
parent::setUp();
$migration = entity_load('migration', 'd6_book_settings');
$dumps = array(
dirname(__DIR__) . '/Dump/Drupal6BookSettings.php',
$this->getDumpDirectory() . '/Drupal6BookSettings.php',
);
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, new MigrateMessage());
......
......@@ -46,7 +46,7 @@ protected function setUp() {
$this->prepareIdMappings($id_mappings);
// Load database dumps to provide source data.
$dumps = array(
drupal_get_path('module', 'migrate_drupal') . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php',
$this->getDumpDirectory() . '/Drupal6Book.php',
);
$this->loadDumps($dumps);
// Migrate books..
......
......@@ -73,9 +73,8 @@ protected function setUp() {
),
);
$this->prepareIdMappings($id_mappings);
$path = drupal_get_path('module', 'migrate_drupal');
$dumps = array(
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeRevision.php',
$this->getDumpDirectory() . '/Drupal6NodeRevision.php',
);
$this->loadDumps($dumps);
......
......@@ -57,7 +57,7 @@ public function setUp() {
$migration = entity_load('migration', 'd6_comment');
$dumps = array(
drupal_get_path('module', 'migrate_drupal') . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php',
$this->getDumpDirectory() . '/Drupal6Comment.php',
);
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, $this);
......
......@@ -67,7 +67,7 @@ protected function setUp() {
))->save();
}
$this->dumps = array(
drupal_get_path('module', 'migrate_drupal') . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php',
$this->getDumpDirectory() . '/Drupal6CommentVariable.php',
);
$id_mappings = array(
'd6_comment_field_instance' => array(
......
......@@ -39,7 +39,7 @@ public function setUp() {
/** @var \Drupal\migrate\entity\Migration $migration */
$migration = entity_load('migration', 'd6_comment_field');
$dumps = array(
drupal_get_path('module', 'migrate_drupal') . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php',
$this->getDumpDirectory() . '/Drupal6CommentVariable.php',
);
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, $this);
......
......@@ -56,7 +56,7 @@ public function setUp() {
/** @var \Drupal\migrate\entity\Migration $migration */
$migration = entity_load('migration', 'd6_comment_field_instance');
$dumps = array(
drupal_get_path('module', 'migrate_drupal') . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php',
$this->getDumpDirectory() . '/Drupal6CommentVariable.php',
);
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, $this);
......
......@@ -42,7 +42,7 @@ public function setUp() {
parent::setUp();
$migration = entity_load('migration', 'd6_contact_category');
$dumps = array(
drupal_get_path('module', 'migrate_drupal') . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php',
$this->getDumpDirectory() . '/Drupal6ContactCategory.php',
);
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, new MigrateMessage());
......
......@@ -41,7 +41,7 @@ public function setUp() {
parent::setUp();
$migration = entity_load('migration', 'd6_contact_settings');
$dumps = array(
dirname(__DIR__) . '/Dump/Drupal6ContactSettings.php',
$this->getDumpDirectory() . '/Drupal6ContactSettings.php',
);
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, new MigrateMessage());
......
......@@ -43,7 +43,7 @@ public function setUp() {
/** @var \Drupal\migrate\entity\Migration $migration */
$migration = entity_load('migration', 'd6_custom_block');
$dumps = array(
drupal_get_path('module', 'migrate_drupal') . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php',
$this->getDumpDirectory() . '/Drupal6Box.php',
);
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, $this);
......
......@@ -32,7 +32,7 @@ public function setUp() {
/** @var \Drupal\migrate\entity\Migration $migration */
$migration = entity_load('migration', 'd6_date_formats');
$dumps = array(
drupal_get_path('module', 'migrate_drupal') . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php',
$this->getDumpDirectory() . '/Drupal6DateFormat.php',
);
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, new MigrateMessage());
......
......@@ -41,7 +41,7 @@ public function setUp() {
parent::setUp();
$migration = entity_load('migration', 'd6_dblog_settings');
$dumps = array(
dirname(__DIR__) . '/Dump/Drupal6DblogSettings.php',
$this->getDumpDirectory() . '/Drupal6DblogSettings.php',
);
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, new MigrateMessage());
......
......@@ -79,66 +79,66 @@ public function tearDown() {
* Test the complete Drupal 6 migration.
*/
public function testDrupal6() {
$path = drupal_get_path('module', 'migrate_drupal');
$tests_path = $this->getDumpDirectory();
$dumps = array(
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ActionSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6BookSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DblogSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FileSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FilterFormat.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ForumSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6LocaleSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6MenuSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeRevision.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SimpletestSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6StatisticsSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SyslogSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemCron.php',
$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 dump contains the file directory path to the simpletest directory
// where the files are.
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFile.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemFilter.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImageGd.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemImage.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemMaintenance.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemPerformance.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemRss.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemSite.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SystemTheme.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomySettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TextSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UpdateSettings.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserMail.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserRole.php',
$path . '/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php',
$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);
$migrations = array(
......
......@@ -33,7 +33,7 @@ public function setUp() {
parent::setUp();
$migration = entity_load('migration', 'd6_field_settings');
$dumps = array(
dirname(__DIR__) . '/Dump/Drupal6FieldSettings.php',
$this->getDumpDirectory() . '/Drupal6FieldSettings.php',
);
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, $this);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment