Skip to content
MigrateNodeConfigsTest.php 1.32 KiB
Newer Older
<?php

/**
 * @file
 * Contains \Drupal\migrate_drupal\Tests\d6\MigrateSystemSiteTest.
 */

namespace Drupal\migrate_drupal\Tests\d6;

use Drupal\config\Tests\SchemaCheckTestTrait;
use Drupal\migrate\MigrateMessage;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;

 * Upgrade variables to node.settings.yml.
 *
 * @group migrate_drupal
class MigrateNodeConfigsTest extends MigrateDrupalTestBase {

  /**
   * Modules to enable.
   *
   * @var array
   */
  public static $modules = array('node');

    $migration = entity_load('migration', 'd6_node_settings');
    $dumps = array(
      $this->getDumpDirectory() . '/Drupal6NodeSettings.php',
    );
    $this->prepare($migration, $dumps);
    $executable = new MigrateExecutable($migration, new MigrateMessage);
    $executable->import();
  }

  /**
   * Tests Drupal 6 node settings to Drupal 8 migration.
   */
  public function testNodeSettings() {
    $config = \Drupal::config('node.settings');
    $this->assertIdentical($config->get('use_admin_theme'), FALSE);
    $this->assertIdentical($config->get('items_per_page'), 3);
    $this->assertConfigSchema(\Drupal::service('config.typed'), 'node.settings', $config->get());