/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $id_mappings = array('d6_user_picture_field_instance' => array(array(array(1), array('user', 'user', 'user_picture')))); $this->prepareMigrations($id_mappings); $this->executeMigration('d6_user_picture_entity_form_display'); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->installSchema('user', array('users_data')); $this->loadDumps(['Users.php', 'ProfileValues.php', 'UsersRoles.php', 'EventTimezones.php']); $id_mappings = array('d6_user' => array(array(array(2), array(2)), array(array(8), array(8)), array(array(15), array(15)))); $this->prepareMigrations($id_mappings); $this->executeMigration('d6_user_contact_settings'); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); entity_create('node_type', array('type' => 'article'))->save(); entity_create('node_type', array('type' => 'story'))->save(); entity_create('node_type', array('type' => 'page'))->save(); $id_mappings = array('d6_upload_field_instance' => array(array(array(1), array('node', 'page', 'upload')))); $this->prepareMigrations($id_mappings); $this->loadDumps(['NodeType.php', 'Variable.php']); $this->executeMigration('d6_upload_entity_form_display'); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); entity_create('node_type', array('type' => 'test_page'))->save(); entity_create('node_type', array('type' => 'story'))->save(); // Add some id mappings for the dependant migrations. $id_mappings = array('d6_field_instance' => array(array(array('fieldname', 'page'), array('node', 'fieldname', 'page'))), 'd6_field' => array(array(array('field_test'), array('node', 'field_test')), array(array('field_test_two'), array('node', 'field_test_two')), array(array('field_test_three'), array('node', 'field_test_three')), array(array('field_test_email'), array('node', 'field_test_email')), array(array('field_test_link'), array('node', 'field_test_link')), array(array('field_test_filefield'), array('node', 'field_test_filefield')), array(array('field_test_imagefield'), array('node', 'field_test_imagefield')), array(array('field_test_phone'), array('node', 'field_test_phone')), array(array('field_test_date'), array('node', 'field_test_date')), array(array('field_test_datestamp'), array('node', 'field_test_datestamp')), array(array('field_test_datetime'), array('node', 'field_test_datetime')))); $this->prepareMigrations($id_mappings); $this->loadDumps(['ContentNodeFieldInstance.php', 'ContentNodeField.php', 'ContentFieldTest.php', 'ContentFieldTestTwo.php', 'ContentFieldMultivalue.php']); $this->executeMigration('d6_field_instance_widget_settings'); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); foreach (['comment', 'comment_no_subject'] as $comment_type) { entity_create('comment_type', array('id' => $comment_type, 'target_entity_type_id' => 'node'))->save(); } // Add some id mappings for the dependant migrations. $id_mappings = array('d6_comment_type' => array(array(array('comment'), array('comment_no_subject')))); $this->prepareMigrations($id_mappings); $this->loadDumps(['Variable.php', 'NodeType.php']); $this->executeMigration('d6_comment_entity_form_display_subject'); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); entity_create('field_storage_config', array('entity_type' => 'node', 'field_name' => 'comment', 'type' => 'comment', 'translatable' => '0'))->save(); foreach ($this->types as $type) { entity_create('node_type', array('type' => $type))->save(); entity_create('field_config', array('label' => 'Comments', 'description' => '', 'field_name' => 'comment', 'entity_type' => 'node', 'bundle' => $type, 'required' => 1))->save(); } $id_mappings = array('d6_comment_field_instance' => array(array(array('page'), array('node', 'comment', 'page')))); $this->prepareMigrations($id_mappings); $this->loadDumps(['Variable.php', 'NodeType.php']); $this->executeMigration(static::MIGRATION); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); // Add some id mappings for the dependant migrations. $id_mappings = array('d6_comment_field' => array(array(array('page'), array('node', 'page'))), 'd6_node_type' => array(array(array('page'), array('page')))); $this->prepareMigrations($id_mappings); foreach (array('page', 'story', 'article') as $type) { entity_create('node_type', array('type' => $type))->save(); } entity_create('field_storage_config', array('entity_type' => 'node', 'field_name' => 'comment', 'type' => 'comment', 'translatable' => '0'))->save(); entity_create('field_storage_config', array('entity_type' => 'node', 'field_name' => 'comment_no_subject', 'type' => 'comment', 'translatable' => '0'))->save(); $this->loadDumps(['Variable.php', 'NodeType.php']); $this->executeMigration('d6_comment_field_instance'); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->installEntitySchema('file'); $this->installEntitySchema('node'); $this->installSchema('file', ['file_usage']); $this->installSchema('node', ['node_access']); // Create new file entities. for ($i = 1; $i <= 3; $i++) { $file = entity_create('file', array('fid' => $i, 'uid' => 1, 'filename' => 'druplicon.txt', 'uri' => "public://druplicon-{$i}.txt", 'filemime' => 'text/plain', 'created' => 1, 'changed' => 1, 'status' => FILE_STATUS_PERMANENT)); $file->enforceIsNew(); file_put_contents($file->getFileUri(), 'hello world'); // Save it, inserting a new record. $file->save(); $id_mappings['d6_file'][] = array(array($i), array($i)); } // Add a node type. $node_type = entity_create('node_type', array('type' => 'story')); $node_type->save(); // Add a file field. entity_create('field_storage_config', array('field_name' => 'upload', 'entity_type' => 'node', 'type' => 'file', 'cardinality' => -1, 'settings' => array('display_field' => TRUE)))->save(); entity_create('field_config', array('field_name' => 'upload', 'entity_type' => 'node', 'bundle' => 'story'))->save(); $id_mappings['d6_node'] = array(array(array(1), array(1)), array(array(2), array(2))); $this->prepareMigrations($id_mappings); $vids = array(1, 2, 3); for ($i = 1; $i <= 2; $i++) { $node = entity_create('node', array('type' => 'story', 'nid' => $i, 'vid' => array_shift($vids))); $node->enforceIsNew(); $node->save(); if ($i == 1) { $node->vid->value = array_shift($vids); $node->enforceIsNew(FALSE); $node->isDefaultRevision(FALSE); $node->save(); } } $this->loadDumps(['Node.php', 'NodeRevisions.php', 'ContentTypeStory.php', 'ContentTypeTestPlanet.php', 'Upload.php']); }