You are here

public function MigrateIp2CountryConfigurationTest::testConfigurationMigration in IP-based Determination of a Visitor's Country 8

Same name in this branch
  1. 8 tests/src/Kernel/Migrate/d6/MigrateIp2CountryConfigurationTest.php \Drupal\Tests\ip2country\Kernel\Migrate\d6\MigrateIp2CountryConfigurationTest::testConfigurationMigration()
  2. 8 tests/src/Kernel/Migrate/d7/MigrateIp2CountryConfigurationTest.php \Drupal\Tests\ip2country\Kernel\Migrate\d7\MigrateIp2CountryConfigurationTest::testConfigurationMigration()

Tests that all configurations values got migrated as expected.

File

tests/src/Kernel/Migrate/d7/MigrateIp2CountryConfigurationTest.php, line 62

Class

MigrateIp2CountryConfigurationTest
Migrates various configuration objects owned by the Ip2Country module.

Namespace

Drupal\Tests\ip2country\Kernel\Migrate\d7

Code

public function testConfigurationMigration() {
  foreach ($this->expectedConfig as $config_id => $values) {
    $actual = \Drupal::config($config_id)
      ->get();
    unset($actual['_core']);

    // Comparison via assertSame() requires arrays to be in identical order.
    ksort($actual);
    ksort($values);
    $this
      ->assertSame($actual, $values, $config_id . ' matches expected values.');
  }
}