MigrateUpgrade7Test.php 2.12 KB
Newer Older
1 2
<?php

3
namespace Drupal\Tests\migrate_drupal_ui\Functional\d7;
4

5
use Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeTestBase;
6
use Drupal\user\Entity\User;
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

/**
 * Tests Drupal 7 upgrade using the migrate UI.
 *
 * The test method is provided by the MigrateUpgradeTestBase class.
 *
 * @group migrate_drupal_ui
 */
class MigrateUpgrade7Test extends MigrateUpgradeTestBase {

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();
    $this->loadFixture(drupal_get_path('module', 'migrate_drupal') . '/tests/fixtures/drupal7.php');
  }

  /**
   * {@inheritdoc}
   */
  protected function getSourceBasePath() {
    return __DIR__ . '/files';
  }

  /**
   * {@inheritdoc}
   */
  protected function getEntityCounts() {
    return [
37 38
      'aggregator_item' => 10,
      'aggregator_feed' => 1,
39 40 41 42
      'block' => 25,
      'block_content' => 1,
      'block_content_type' => 1,
      'comment' => 1,
43
      'comment_type' => 8,
44 45
      // Module 'language' comes with 'en', 'und', 'zxx'. Migration adds 'is'.
      'configurable_language' => 4,
46 47
      'contact_form' => 3,
      'editor' => 2,
48 49
      'field_config' => 52,
      'field_storage_config' => 39,
50
      'file' => 2,
51 52
      'filter_format' => 7,
      'image_style' => 6,
53
      'language_content_settings' => 2,
54
      'migration' => 73,
55
      'node' => 3,
56
      'node_type' => 6,
57
      'rdf_mapping' => 7,
58 59 60
      'search_page' => 2,
      'shortcut' => 6,
      'shortcut_set' => 2,
61
      'action' => 16,
62
      'menu' => 6,
63
      'taxonomy_term' => 18,
64
      'taxonomy_vocabulary' => 4,
65
      'tour' => 4,
66
      'user' => 4,
67
      'user_role' => 3,
68
      'menu_link_content' => 7,
69
      'view' => 15,
70
      'date_format' => 11,
71
      'entity_form_display' => 18,
72
      'entity_form_mode' => 1,
73 74 75
      'entity_view_display' => 29,
      'entity_view_mode' => 14,
      'base_field_override' => 9,
76 77 78
    ];
  }

79 80 81
  /**
   * Executes all steps of migrations upgrade.
   */
82
  public function testMigrateUpgrade() {
83 84 85 86
    parent::testMigrateUpgrade();

    // Ensure migrated users can log in.
    $user = User::load(2);
87
    $user->passRaw = 'a password';
88 89 90
    $this->drupalLogin($user);
  }

91
}