class MigrateForumSettingsTest

Same name and namespace in other branches
  1. 10 core/modules/forum/tests/src/Kernel/Migrate/d7/MigrateForumSettingsTest.php \Drupal\Tests\forum\Kernel\Migrate\d7\MigrateForumSettingsTest
  2. 8.9.x core/modules/forum/tests/src/Kernel/Migrate/d7/MigrateForumSettingsTest.php \Drupal\Tests\forum\Kernel\Migrate\d7\MigrateForumSettingsTest

Tests migration of Forum's variables to configuration.

@group forum

Hierarchy

Expanded class hierarchy of MigrateForumSettingsTest

File

core/modules/forum/tests/src/Kernel/Migrate/d7/MigrateForumSettingsTest.php, line 12

Namespace

Drupal\Tests\forum\Kernel\Migrate\d7
View source
class MigrateForumSettingsTest extends MigrateDrupal7TestBase {
  
  /**
   * Modules to enable.
   *
   * Don't alphabetize these. They're in dependency order.
   *
   * @var array
   */
  protected static $modules = [
    'comment',
    'field',
    'filter',
    'text',
    'node',
    'taxonomy',
    'forum',
  ];
  
  /**
   * {@inheritdoc}
   */
  protected function setUp() : void {
    parent::setUp();
    $this->executeMigration('d7_taxonomy_vocabulary');
    $this->executeMigration('d7_forum_settings');
  }
  
  /**
   * Tests the migration of Forum's settings to configuration.
   */
  public function testForumSettingsMigration() {
    $config = $this->config('forum.settings');
    $this->assertSame(9, $config->get('block.active.limit'));
    $this->assertSame(4, $config->get('block.new.limit'));
    $this->assertSame(10, $config->get('topics.hot_threshold'));
    $this->assertSame(25, $config->get('topics.page_limit'));
    $this->assertSame(1, $config->get('topics.order'));
    $this->assertSame('forums', $config->get('vocabulary'));
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.