MigrateFileConfigsTest.php 971 Bytes
Newer Older
1 2
<?php

3
namespace Drupal\Tests\file\Kernel\Migrate\d6;
4

5
use Drupal\config\Tests\SchemaCheckTestTrait;
6
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
7 8

/**
9 10
 * Upgrade variables to file.settings.yml.
 *
11
 * @group migrate_drupal_6
12
 */
13
class MigrateFileConfigsTest extends MigrateDrupal6TestBase {
14

15 16
  use SchemaCheckTestTrait;

17
  /**
18
   * {@inheritdoc}
19
   */
20
  protected function setUp() {
21
    parent::setUp();
22
    $this->executeMigration('file_settings');
23 24 25 26 27 28
  }

  /**
   * Tests migration of file variables to file.settings.yml.
   */
  public function testFileSettings() {
29
    $config = $this->config('file.settings');
30 31 32
    $this->assertIdentical('textfield', $config->get('description.type'));
    $this->assertIdentical(128, $config->get('description.length'));
    $this->assertIdentical('sites/default/files/icons', $config->get('icon.directory'));
33
    $this->assertConfigSchema(\Drupal::service('config.typed'), 'file.settings', $config->get());
34
  }
35

36
}