Commit 13a660ba authored by catch's avatar catch
Browse files

Issue #3270897 by quietone, yogeshmpawar, bbrala: Handle migration tests for removing Color

parent 1a598382
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
      "modules/aggregator/tests/fixtures/drupal7.php",
      "modules/ckeditor5/js/build/*",
      "modules/color/preview.html",
      "modules/color/tests/fixtures/drupal7.php",
      "modules/color/tests/modules/color_test/themes/color_test_theme/color/preview.html",
      "modules/media/tests/fixtures/oembed/*",
      "modules/migrate_drupal/tests/fixtures/drupal6.php",
+26061 −0

File added.

Preview size limit exceeded, changes collapsed.

+74 −0
Original line number Diff line number Diff line
<?php

namespace Drupal\Tests\color\Functional\Migrate;

use Drupal\Tests\migrate_drupal_ui\Functional\NoMultilingualReviewPageTestBase;

/**
 * Tests review page.
 *
 * The test method is provided by the MigrateUpgradeTestBase class.
 *
 * @group color
 */
class NoMultilingualReviewPageTest extends NoMultilingualReviewPageTestBase {

  /**
   * {@inheritdoc}
   */
  protected static $modules = ['color'];

  /**
   * {@inheritdoc}
   */
  protected function setUp(): void {
    parent::setUp();
    $this->loadFixture($this->getModulePath('color') . '/tests/fixtures/drupal7.php');
  }

  /**
   * Tests that Color is displayed in the will be upgraded list.
   */
  public function testMigrateUpgradeReviewPage() {
    $this->prepare();
    // Start the upgrade process.
    $this->submitCredentialForm();

    $session = $this->assertSession();
    $this->submitForm([], 'I acknowledge I may lose data. Continue anyway.');
    $session->statusCodeEquals(200);

    // Confirm that Color will be upgraded.
    $session->elementExists('xpath', "//td[contains(@class, 'checked') and text() = 'Color']");
    $session->elementNotExists('xpath', "//td[contains(@class, 'error') and text() = 'Color']");
  }

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

  /**
   * {@inheritdoc}
   */
  protected function getAvailablePaths() {
    return [];
  }

  /**
   * {@inheritdoc}
   */
  protected function getIncompletePaths() {
    return [];
  }

  /**
   * {@inheritdoc}
   */
  protected function getMissingPaths() {
    return [];
  }

}
+7 −0
Original line number Diff line number Diff line
@@ -26,6 +26,13 @@ protected function setUp(): void {
    $this->executeMigration('d7_color');
  }

  /**
   * Gets the path to the fixture file.
   */
  protected function getFixtureFilePath() {
    return __DIR__ . '/../../../../fixtures/drupal7.php';
  }

  /**
   * Tests migration of color's variables to configuration.
   */
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ class StateFileExistsTest extends MigrateDrupalTestBase {
    'block',
    'block_content',
    'book',
    // @todo Remove Color in https://www.drupal.org/project/drupal/issues/3270899
    'color',
    'comment',
    'config_translation',
Loading