/**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('comment');
     CommentType::create(['id' => 'comment_node_page', 'label' => $this->randomMachineName()])->save();
     CommentType::create(['id' => 'comment_node_article', 'label' => $this->randomMachineName()])->save();
     CommentType::create(['id' => 'comment_node_blog', 'label' => $this->randomMachineName()])->save();
     CommentType::create(['id' => 'comment_node_book', 'label' => $this->randomMachineName()])->save();
     CommentType::create(['id' => 'comment_node_forum', 'label' => $this->randomMachineName()])->save();
     CommentType::create(['id' => 'comment_node_test_content_type', 'label' => $this->randomMachineName()])->save();
     $this->installEntitySchema('node');
     NodeType::create(['type' => 'page', 'label' => $this->randomMachineName()])->save();
     NodeType::create(['type' => 'article', 'label' => $this->randomMachineName()])->save();
     NodeType::create(['type' => 'blog', 'label' => $this->randomMachineName()])->save();
     NodeType::create(['type' => 'book', 'label' => $this->randomMachineName()])->save();
     NodeType::create(['type' => 'forum', 'label' => $this->randomMachineName()])->save();
     NodeType::create(['type' => 'test_content_type', 'label' => $this->randomMachineName()])->save();
     // Give one unfortunate field instance invalid display settings to ensure
     // that the migration provides an empty array as a default (thus avoiding
     // an "unsupported operand types" fatal).
     Database::getConnection('default', 'migrate')->update('field_config_instance')->fields(array('data' => serialize(array('label' => 'Body', 'widget' => array('type' => 'text_textarea_with_summary', 'settings' => array('rows' => 20, 'summary_rows' => 5), 'weight' => -4, 'module' => 'text'), 'settings' => array('display_summary' => true, 'text_processing' => 1, 'user_register_form' => false), 'display' => array('default' => array('label' => 'hidden', 'type' => 'text_default', 'settings' => array(), 'module' => 'text', 'weight' => 0), 'teaser' => array('label' => 'hidden', 'type' => 'text_summary_or_trimmed', 'settings' => NULL, 'module' => 'text', 'weight' => 0)), 'required' => false, 'description' => ''))))->condition('entity_type', 'node')->condition('bundle', 'article')->condition('field_name', 'body')->execute();
     $this->executeMigration('d7_field');
     $this->executeMigration('d7_field_instance');
     $this->executeMigration('d7_view_modes');
     $this->executeMigration('d7_field_formatter_settings');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installConfig(static::$modules);
     $this->installEntitySchema('block_content');
     $this->executeMigrations(['d7_filter_format', 'block_content_type', 'block_content_body_field', 'd7_custom_block']);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installConfig(['block_content']);
     $this->installEntitySchema('block_content');
     $this->executeMigrations(['block_content_type', 'block_content_body_field']);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('comment');
     $this->installEntitySchema('node');
     $this->executeMigration('d7_view_modes');
 }
Example #5
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Prepare to migrate user pictures as well.
     $this->installEntitySchema('file');
     $this->executeMigrations(['user_picture_field', 'user_picture_field_instance', 'd7_user_role', 'd7_user']);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installConfig(static::$modules);
     $this->loadDumps(['Variable.php']);
     $this->executeMigration('d7_dblog_settings');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installConfig(static::$modules);
     $this->executeMigration('d7_node_type');
     $this->executeMigration('d7_comment_type');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installConfig(static::$modules);
     $this->installEntitySchema('node');
     $this->executeMigrations(['d7_node_type', 'd7_node_title_label']);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->executeMigration('user_picture_field');
     $this->executeMigration('user_picture_field_instance');
     $this->executeMigration('user_picture_entity_form_display');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installConfig(['statistics']);
     $this->loadDumps(['Variable.php']);
     $this->executeMigration('statistics_popular_block_settings');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installSchema('system', ['router']);
     $this->installEntitySchema('menu_link_content');
     $this->executeMigration('menu');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('file');
     $this->executeMigration('user_picture_field');
     $this->executeMigration('user_picture_field_instance');
     $this->executeMigration('user_picture_entity_display');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('aggregator_feed');
     $this->installEntitySchema('aggregator_item');
     $this->executeMigration('d7_aggregator_feed');
     $this->executeMigration('d7_aggregator_item');
 }
Example #14
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installSchema('system', ['router']);
     $this->installEntitySchema('menu_link_content');
     $this->executeMigration('menu');
     \Drupal::service('router.builder')->rebuild();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('node');
     $this->installEntitySchema('comment');
     $this->installEntitySchema('taxonomy_term');
     $this->installConfig(static::$modules);
     $this->executeMigrations(['d7_node_type', 'd7_comment_type', 'd7_field', 'd7_field_instance', 'd7_field_instance_widget_settings']);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('node');
     $this->installConfig(static::$modules);
     $this->installSchema('node', ['node_access']);
     $this->installSchema('tracker', ['tracker_node', 'tracker_user']);
     $this->executeMigrations(['d7_user_role', 'd7_user', 'd7_node_type', 'd7_node__test_content_type', 'd7_tracker_node']);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installConfig(static::$modules);
     $this->executeMigration('d7_node_type');
     $this->executeMigration('d7_comment_type');
     $this->executeMigration('d7_comment_field');
     $this->executeMigration('d7_comment_field_instance');
     $this->executeMigration('d7_comment_entity_form_display');
 }
Example #18
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('node');
     $this->installEntitySchema('comment');
     $this->installEntitySchema('taxonomy_term');
     $this->installConfig(static::$modules);
     $this->installSchema('node', ['node_access']);
     $this->installSchema('system', ['sequences']);
     $this->executeMigrations(['d7_user_role', 'd7_user', 'd7_node_type', 'd7_comment_type', 'd7_field', 'd7_field_instance', 'd7_node__test_content_type']);
 }
Example #19
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installSchema('system', array('router'));
     $this->installEntitySchema('shortcut');
     $this->installEntitySchema('menu_link_content');
     $this->executeMigration('d7_shortcut_set');
     $this->executeMigration('menu');
     $this->executeMigration('d7_menu_links');
     $this->executeMigration('d7_shortcut');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('node');
     $this->installConfig(['node']);
     $this->installSchema('node', ['node_access']);
     $this->installSchema('system', ['sequences']);
     $this->executeMigration('d7_user_role');
     $this->executeMigration('d7_user');
     $this->executeMigration('d7_node_type');
     $this->executeMigration('d7_node__test_content_type');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installConfig(static::$modules);
     $this->createType('page');
     $this->createType('article');
     $this->createType('blog');
     $this->createType('book');
     $this->createType('forum');
     $this->createType('test_content_type');
     $this->executeMigrations(['d7_field', 'd7_field_instance']);
 }
Example #22
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installConfig(static::$modules);
     $this->installEntitySchema('node');
     $this->installEntitySchema('comment');
     $this->executeMigrations(['d7_filter_format', 'd7_user_role', 'd7_user']);
     $this->executeMigration('d7_node_type');
     // We only need the test_content_type node migration to run for real, so
     // mock all the others.
     $this->prepareMigrations(array('d7_node:*' => array(array(array(0), array(0)))));
     $this->executeMigrations(['d7_node__test_content_type', 'd7_comment_type', 'd7_comment']);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('node');
     $this->installEntitySchema('taxonomy_term');
     $this->installConfig(static::$modules);
     $this->installSchema('node', ['node_access']);
     $this->installSchema('system', ['sequences']);
     $this->executeMigration('d7_node_type');
     FieldStorageConfig::create(array('type' => 'entity_reference', 'field_name' => 'field_tags', 'entity_type' => 'node', 'settings' => array('target_type' => 'taxonomy_term'), 'cardinality' => FieldStorageConfigInterface::CARDINALITY_UNLIMITED))->save();
     FieldConfig::create(array('entity_type' => 'node', 'field_name' => 'field_tags', 'bundle' => 'article'))->save();
     $this->executeMigrations(['d7_taxonomy_vocabulary', 'd7_taxonomy_term', 'd7_user_role', 'd7_user', 'd7_node__article']);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installConfig(static::$modules);
     $this->installEntitySchema('block_content');
     // Set Bartik and Seven as the default public and admin theme.
     $config = $this->config('system.theme');
     $config->set('default', 'bartik');
     $config->set('admin', 'seven');
     $config->save();
     // Install one of D8's test themes.
     \Drupal::service('theme_handler')->install(['bartik']);
     $this->executeMigrations(['d7_filter_format', 'd7_user_role', 'block_content_type', 'block_content_body_field', 'd7_custom_block', 'd7_block']);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installConfig(static::$modules);
     $this->installEntitySchema('node');
     $this->installEntitySchema('comment');
     $this->executeMigrations(['d7_filter_format', 'd7_user_role', 'd7_user']);
     // The test database doesn't include uid 1, so we'll need to create it.
     User::create(array('uid' => 1, 'name' => 'admin', 'mail' => '*****@*****.**'))->save();
     $this->executeMigration('d7_node_type');
     // We only need the test_content_type node migration to run for real, so
     // mock all the others.
     $this->prepareMigrations(array('d7_node:*' => array(array(array(0), array(0)))));
     $this->executeMigrations(['d7_node__test_content_type', 'd7_comment_type', 'd7_comment']);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installSchema('system', array('router'));
     $this->installEntitySchema('shortcut');
     $this->installEntitySchema('menu_link_content');
     $this->installSchema('shortcut', ['shortcut_set_users']);
     \Drupal::service('router.builder')->rebuild();
     $this->executeMigration('d7_user_role');
     $this->executeMigration('d7_user');
     $this->executeMigration('d7_shortcut_set');
     $this->executeMigration('menu');
     $this->executeMigration('menu_links');
     $this->executeMigration('d7_shortcut');
     $this->executeMigration('d7_shortcut_set_users');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->loadFixture(__DIR__ . '/../../../../tests/fixtures/d6_d7_table.php');
     $this->installSchema('acl', ['acl', 'acl_user', 'acl_node']);
     $this->installSchema('node', ['node_access']);
     $this->executeMigration('d6_d7_acl');
     $this->executeMigration('d6_d7_acl_user');
     $this->executeMigration('d6_d7_acl_node');
     $this->installEntitySchema('node');
     $this->installEntitySchema('comment');
     $this->installEntitySchema('taxonomy_term');
     $this->installConfig(static::$modules);
     $this->installSchema('system', ['sequences']);
     $this->executeMigrations(['d7_user_role', 'd7_user', 'd7_node_type', 'd7_comment_type', 'd7_field', 'd7_field_instance', 'd7_node__test_content_type', 'd7_node_settings', 'd7_node:*', 'd7_node_revision:*']);
 }
Example #28
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('file');
     $fs = \Drupal::service('file_system');
     // The public file directory active during the test will serve as the
     // root of the fictional Drupal 7 site we're migrating.
     $fs->mkdir('public://sites/default/files', NULL, TRUE);
     file_put_contents('public://sites/default/files/cube.jpeg', str_repeat('*', 3620));
     /** @var \Drupal\migrate\Entity\MigrationInterface $migration */
     $migration = entity_load('migration', 'd7_file');
     // Set the destination plugin's source_base_path configuration value, which
     // would normally be set by the user running the migration.
     $migration->set('destination', ['plugin' => 'entity:file', 'source_base_path' => $fs->realpath($this->publicFilesDirectory) . '/', 'source_path_property' => 'filepath']);
     $this->executeMigration($migration);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('comment');
     CommentType::create(['id' => 'comment_node_page', 'label' => $this->randomMachineName()])->save();
     CommentType::create(['id' => 'comment_node_article', 'label' => $this->randomMachineName()])->save();
     CommentType::create(['id' => 'comment_node_blog', 'label' => $this->randomMachineName()])->save();
     CommentType::create(['id' => 'comment_node_book', 'label' => $this->randomMachineName()])->save();
     CommentType::create(['id' => 'comment_node_forum', 'label' => $this->randomMachineName()])->save();
     CommentType::create(['id' => 'comment_node_test_content_type', 'label' => $this->randomMachineName()])->save();
     $this->installEntitySchema('node');
     NodeType::create(['type' => 'page', 'label' => $this->randomMachineName()])->save();
     NodeType::create(['type' => 'article', 'label' => $this->randomMachineName()])->save();
     NodeType::create(['type' => 'blog', 'label' => $this->randomMachineName()])->save();
     NodeType::create(['type' => 'book', 'label' => $this->randomMachineName()])->save();
     NodeType::create(['type' => 'forum', 'label' => $this->randomMachineName()])->save();
     NodeType::create(['type' => 'test_content_type', 'label' => $this->randomMachineName()])->save();
     $this->executeMigration('d7_field');
     $this->executeMigration('d7_field_instance');
     $this->executeMigration('d7_view_modes');
     $this->executeMigration('d7_field_formatter_settings');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->executeMigration('d7_language_negotiation_settings');
 }