Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / book / tests / src / Kernel / Migrate / d6 / MigrateBookConfigsTest.php
1 <?php
2
3 namespace Drupal\Tests\book\Kernel\Migrate\d6;
4
5 use Drupal\Tests\SchemaCheckTestTrait;
6 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
7
8 /**
9  * Upgrade variables to book.settings.yml.
10  *
11  * @group migrate_drupal_6
12  */
13 class MigrateBookConfigsTest extends MigrateDrupal6TestBase {
14
15   use SchemaCheckTestTrait;
16
17   /**
18    * {@inheritdoc}
19    */
20   public static $modules = ['book'];
21
22   /**
23    * Data provider for testBookSettings().
24    *
25    * @return array
26    *   The data for each test scenario.
27    */
28   public function providerBookSettings() {
29     return [
30       // d6_book_settings was renamed to book_settings, but use the old alias to
31       // prove that it works.
32       // @see book_migration_plugins_alter()
33       ['d6_book_settings'],
34       ['book_settings'],
35     ];
36   }
37
38   /**
39    * Tests migration of book variables to book.settings.yml.
40    *
41    * @dataProvider providerBookSettings
42    */
43   public function testBookSettings($migration_id) {
44     $this->executeMigration($migration_id);
45
46     $config = $this->config('book.settings');
47     $this->assertIdentical('book', $config->get('child_type'));
48     $this->assertSame('book pages', $config->get('block.navigation.mode'));
49     $this->assertIdentical(['book'], $config->get('allowed_types'));
50     $this->assertConfigSchema(\Drupal::service('config.typed'), 'book.settings', $config->get());
51   }
52
53 }