MigrateUpgrade7Test.php 2.18 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

/**
 * 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 {

17 18 19 20 21
  /**
   * {@inheritdoc}
   */
  public static $modules = ['file'];

22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
  /**
   * {@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 [
42 43
      'aggregator_item' => 10,
      'aggregator_feed' => 1,
44 45 46 47
      'block' => 25,
      'block_content' => 1,
      'block_content_type' => 1,
      'comment' => 1,
48
      'comment_type' => 8,
49 50
      // Module 'language' comes with 'en', 'und', 'zxx'. Migration adds 'is'.
      'configurable_language' => 4,
51 52
      'contact_form' => 3,
      'editor' => 2,
53 54 55
      'field_config' => 53,
      'field_storage_config' => 40,
      'file' => 3,
56 57
      'filter_format' => 7,
      'image_style' => 6,
58
      'language_content_settings' => 2,
59
      'migration' => 73,
60
      'node' => 3,
61
      'node_type' => 6,
62
      'rdf_mapping' => 7,
63 64 65
      'search_page' => 2,
      'shortcut' => 6,
      'shortcut_set' => 2,
66
      'action' => 16,
67
      'menu' => 6,
68
      'taxonomy_term' => 18,
69
      'taxonomy_vocabulary' => 4,
70
      'tour' => 4,
71
      'user' => 4,
72
      'user_role' => 3,
73
      'menu_link_content' => 7,
74
      'view' => 15,
75
      'date_format' => 11,
76
      'entity_form_display' => 18,
77
      'entity_form_mode' => 1,
78 79 80
      'entity_view_display' => 29,
      'entity_view_mode' => 14,
      'base_field_override' => 9,
81 82 83
    ];
  }

84 85 86
  /**
   * Executes all steps of migrations upgrade.
   */
87
  public function testMigrateUpgrade() {
88 89 90 91
    parent::testMigrateUpgrade();

    // Ensure migrated users can log in.
    $user = User::load(2);
92
    $user->passRaw = 'a password';
93 94 95
    $this->drupalLogin($user);
  }

96
}