MigrateIp2CountryConfigurationTest.php in IP-based Determination of a Visitor's Country 8
File
tests/src/Kernel/Migrate/d6/MigrateIp2CountryConfigurationTest.php
View source
<?php
namespace Drupal\Tests\ip2country\Kernel\Migrate\d6;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
class MigrateIp2CountryConfigurationTest extends MigrateDrupal6TestBase {
public static $modules = [
'ip2country',
];
protected function getFixtureFilePath() {
return __DIR__ . '/../../../../fixtures/migrate/drupal6.php';
}
protected $expectedConfig = [
'ip2country.settings' => [
'watchdog' => FALSE,
'rir' => 'lacnic',
'update_interval' => 302400,
'debug' => TRUE,
'test_type' => 1,
'test_country' => 'UZ',
'test_ip_address' => '73.140.122.15',
],
];
protected function setUp() {
parent::setUp();
$migrations = [
'd6_ip2country_settings',
];
$this
->executeMigrations($migrations);
}
public function testConfigurationMigration() {
foreach ($this->expectedConfig as $config_id => $values) {
$actual = \Drupal::config($config_id)
->get();
unset($actual['_core']);
ksort($actual);
ksort($values);
$this
->assertSame($actual, $values, $config_id . ' matches expected values.');
}
}
}