diff --git a/core/modules/locale/locale.test b/core/modules/locale/locale.test index 5c49be4..3a1e4ee 100644 --- a/core/modules/locale/locale.test +++ b/core/modules/locale/locale.test @@ -2823,3 +2823,28 @@ class LocaleLanguageNegotiationInfoFunctionalTest extends DrupalWebTestCase { } } } + +class LocaleLibraryInfoAlterTest extends DrupalWebTestCase { + public static function getInfo() { + return array( + 'name' => 'Javascript library localisation', + 'description' => 'Tests the localisation of javascript libraries.', + 'group' => 'Locale', + ); + } + + function setUp() { + parent::setUp('locale', 'locale_test'); + } + + /** + * Verify that locale_library_info_alter adds localisation to the datepicker. + * + * @see locale_library_info_alter() + */ + public function testLibraryInfoAlter() { + drupal_add_library('system', 'ui.datepicker'); + $scripts = drupal_get_js('footer'); + $this->assertTrue(strpos($scripts, 'locale.datepicker.js'), t('locale.datepicker.js added to scripts in footer.')); + } +}