function CountryManagerTest::testHookCountriesAlter

Same name in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/Locale/CountryManagerTest.php \Drupal\KernelTests\Core\Locale\CountryManagerTest::testHookCountriesAlter()

Tests that hook_countries_alters() works as expected.

File

core/tests/Drupal/KernelTests/Core/Locale/CountryManagerTest.php, line 29

Class

CountryManagerTest
Tests Country Manager functionality.

Namespace

Drupal\KernelTests\Core\Locale

Code

public function testHookCountriesAlter() : void {
    $countries = $this->container
        ->get('country_manager')
        ->getList();
    self::assertArrayHasKey('EB', $countries);
    self::assertSame('Elbonia', $countries['EB']);
}

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