302c3d1aee3042b9181a1a383a7cd7028e1d1f4f
[yaffs-website] / web / core / modules / forum / tests / src / Kernel / Migrate / d6 / MigrateForumConfigsTest.php
1 <?php
2
3 namespace Drupal\Tests\forum\Kernel\Migrate\d6;
4
5 use Drupal\Tests\SchemaCheckTestTrait;
6 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
7
8 /**
9  * Upgrade variables to forum.settings.yml.
10  *
11  * @group migrate_drupal_6
12  */
13 class MigrateForumConfigsTest extends MigrateDrupal6TestBase {
14
15   use SchemaCheckTestTrait;
16
17   /**
18    * {@inheritdoc}
19    */
20   public static $modules = ['comment', 'forum', 'taxonomy'];
21
22   /**
23    * {@inheritdoc}
24    */
25   protected function setUp() {
26     parent::setUp();
27     $this->executeMigration('d6_taxonomy_vocabulary');
28     $this->executeMigration('d6_forum_settings');
29   }
30
31   /**
32    * Tests migration of forum variables to forum.settings.yml.
33    */
34   public function testForumSettings() {
35     $config = $this->config('forum.settings');
36     $this->assertIdentical(15, $config->get('topics.hot_threshold'));
37     $this->assertIdentical(25, $config->get('topics.page_limit'));
38     $this->assertIdentical(1, $config->get('topics.order'));
39     $this->assertIdentical('forums', $config->get('vocabulary'));
40     // This is 'forum_block_num_0' in D6, but block:active:limit' in D8.
41     $this->assertSame(3, $config->get('block.active.limit'));
42     // This is 'forum_block_num_1' in D6, but 'block:new:limit' in D8.
43     $this->assertSame(4, $config->get('block.new.limit'));
44     $this->assertConfigSchema(\Drupal::service('config.typed'), 'forum.settings', $config->get());
45   }
46
47 }