You are here

public function MigrateIp2CountryDateFormatTest::testDateFormats in IP-based Determination of a Visitor's Country 8

Tests the Drupal 7 date formats to Drupal 8 migration.

The fixture deliberately contains non-default values for the ip2country_date and ip2country_time formats, in order to ensure that the default D8 date format values are overwritten by the migration.

File

tests/src/Kernel/Migrate/d7/MigrateIp2CountryDateFormatTest.php, line 42

Class

MigrateIp2CountryDateFormatTest
Upgrade ip2country date formats to core.date_format.*.yml.

Namespace

Drupal\Tests\ip2country\Kernel\Migrate\d7

Code

public function testDateFormats() {
  $dateOnly = DateFormat::load('ip2country_date');
  $this
    ->assertSame('Y/j/n', $dateOnly
    ->getPattern());
  $timeOnly = DateFormat::load('ip2country_time');
  $this
    ->assertSame('s:i:H T', $timeOnly
    ->getPattern());
}