Mercurial > hg > isophonics-drupal-site
annotate core/modules/locale/tests/src/Functional/LocaleLibraryAlterTest.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\Tests\locale\Functional; |
Chris@0 | 4 |
Chris@0 | 5 use Drupal\Core\Asset\AttachedAssets; |
Chris@0 | 6 use Drupal\Tests\BrowserTestBase; |
Chris@0 | 7 |
Chris@0 | 8 /** |
Chris@0 | 9 * Tests localization of the JavaScript libraries. |
Chris@0 | 10 * |
Chris@0 | 11 * Currently, only the jQuery datepicker is localized using Drupal translations. |
Chris@0 | 12 * |
Chris@0 | 13 * @group locale |
Chris@0 | 14 */ |
Chris@0 | 15 class LocaleLibraryAlterTest extends BrowserTestBase { |
Chris@0 | 16 |
Chris@0 | 17 /** |
Chris@0 | 18 * Modules to enable. |
Chris@0 | 19 * |
Chris@0 | 20 * @var array |
Chris@0 | 21 */ |
Chris@0 | 22 public static $modules = ['locale']; |
Chris@0 | 23 |
Chris@0 | 24 /** |
Chris@0 | 25 * Verifies that the datepicker can be localized. |
Chris@0 | 26 * |
Chris@0 | 27 * @see locale_library_alter() |
Chris@0 | 28 */ |
Chris@0 | 29 public function testLibraryAlter() { |
Chris@0 | 30 $assets = new AttachedAssets(); |
Chris@0 | 31 $assets->setLibraries(['core/jquery.ui.datepicker']); |
Chris@0 | 32 $js_assets = $this->container->get('asset.resolver')->getJsAssets($assets, FALSE)[1]; |
Chris@0 | 33 $this->assertTrue(array_key_exists('core/modules/locale/locale.datepicker.js', $js_assets), 'locale.datepicker.js added to scripts.'); |
Chris@0 | 34 } |
Chris@0 | 35 |
Chris@0 | 36 } |