class CountryManagerTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/Core/Locale/CountryManagerTest.php \Drupal\KernelTests\Core\Locale\CountryManagerTest
Tests Country Manager functionality.
@group CountryManager
@covers Drupal\Core\Locale\CountryManager
Hierarchy
- class \Drupal\KernelTests\Core\Locale\CountryManagerTest
Expanded class hierarchy of CountryManagerTest
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Locale/ CountryManagerTest.php, line 15
Namespace
Drupal\KernelTests\Core\LocaleView source
class CountryManagerTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'language',
'locale',
'locale_test',
];
/**
* Tests that hook_countries_alters() works as expected.
*/
public function testHookCountriesAlter() : void {
$countries = $this->container
->get('country_manager')
->getList();
self::assertArrayHasKey('EB', $countries);
self::assertSame('Elbonia', $countries['EB']);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
CountryManagerTest::$modules | protected static | property | Modules to install. |
CountryManagerTest::testHookCountriesAlter | public | function | Tests that hook_countries_alters() works as expected. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.