MigrateStatisticsConfigsTest.php

Same filename in this branch
  1. 10 core/modules/statistics/tests/src/Kernel/Migrate/d6/MigrateStatisticsConfigsTest.php
Same filename and directory in other branches
  1. 9 core/modules/statistics/tests/src/Kernel/Migrate/d6/MigrateStatisticsConfigsTest.php
  2. 9 core/modules/statistics/tests/src/Kernel/Migrate/d7/MigrateStatisticsConfigsTest.php
  3. 8.9.x core/modules/statistics/tests/src/Kernel/Migrate/d6/MigrateStatisticsConfigsTest.php
  4. 8.9.x core/modules/statistics/tests/src/Kernel/Migrate/d7/MigrateStatisticsConfigsTest.php
  5. 11.x core/modules/statistics/tests/src/Kernel/Migrate/d6/MigrateStatisticsConfigsTest.php
  6. 11.x core/modules/statistics/tests/src/Kernel/Migrate/d7/MigrateStatisticsConfigsTest.php

Namespace

Drupal\Tests\statistics\Kernel\Migrate\d7

File

core/modules/statistics/tests/src/Kernel/Migrate/d7/MigrateStatisticsConfigsTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\statistics\Kernel\Migrate\d7;

use Drupal\Tests\SchemaCheckTestTrait;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;

/**
 * Upgrade variables to statistics.settings.yml.
 *
 * @group statistics
 * @group legacy
 */
class MigrateStatisticsConfigsTest extends MigrateDrupal7TestBase {
  use SchemaCheckTestTrait;
  
  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'statistics',
  ];
  
  /**
   * {@inheritdoc}
   */
  protected function setUp() : void {
    parent::setUp();
    $this->executeMigration('statistics_settings');
  }
  
  /**
   * Gets the path to the fixture file.
   */
  protected function getFixtureFilePath() {
    return __DIR__ . '/../../../../fixtures/drupal7.php';
  }
  
  /**
   * Tests migration of statistics variables to statistics.settings.yml.
   */
  public function testStatisticsSettings() : void {
    $config = $this->config('statistics.settings');
    $this->assertSame(1, $config->get('count_content_views'));
    $this->assertConfigSchema(\Drupal::service('config.typed'), 'statistics.settings', $config->get());
  }

}

Classes

Title Deprecated Summary
MigrateStatisticsConfigsTest Upgrade variables to statistics.settings.yml.

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