You are here

public function LocaleLibraryAlterTest::testLibraryAlter in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/locale/src/Tests/LocaleLibraryAlterTest.php \Drupal\locale\Tests\LocaleLibraryAlterTest::testLibraryAlter()

Verifies that the datepicker can be localized.

See also

locale_library_alter()

File

core/modules/locale/src/Tests/LocaleLibraryAlterTest.php, line 33
Contains \Drupal\locale\Tests\LocaleLibraryAlterTest.

Class

LocaleLibraryAlterTest
Tests localization of the JavaScript libraries.

Namespace

Drupal\locale\Tests

Code

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