You are here

public function LocaleLibraryAlterTest::testLibraryAlter in Drupal 8

Verifies that the datepicker can be localized.

See also

locale_library_alter()

File

core/modules/locale/tests/src/Kernel/LocaleLibraryAlterTest.php, line 27

Class

LocaleLibraryAlterTest
Tests localization of the JavaScript libraries.

Namespace

Drupal\Tests\locale\Kernel

Code

public function testLibraryAlter() {
  $this
    ->installSchema('locale', [
    'locales_location',
    'locales_source',
  ]);
  $assets = new AttachedAssets();
  $assets
    ->setLibraries([
    'core/jquery.ui.datepicker',
  ]);
  $js_assets = $this->container
    ->get('asset.resolver')
    ->getJsAssets($assets, FALSE)[1];
  $this
    ->assertArrayHasKey('core/modules/locale/locale.datepicker.js', $js_assets);
}