Skip to content
Snippets Groups Projects
Commit 2d1e404b authored by catch's avatar catch
Browse files

Issue #3046392 by claudiu.cristea: Convert LocaleLibraryAlterTest into a Kernel test

parent 2a6d8d71
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
<?php
namespace Drupal\Tests\locale\Functional;
namespace Drupal\Tests\locale\Kernel;
use Drupal\Core\Asset\AttachedAssets;
use Drupal\Tests\BrowserTestBase;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests localization of the JavaScript libraries.
......@@ -12,14 +12,12 @@
*
* @group locale
*/
class LocaleLibraryAlterTest extends BrowserTestBase {
class LocaleLibraryAlterTest extends KernelTestBase {
/**
* Modules to enable.
*
* @var array
* {@inheritdoc}
*/
public static $modules = ['locale'];
protected static $modules = ['locale'];
/**
* Verifies that the datepicker can be localized.
......@@ -27,10 +25,15 @@ class LocaleLibraryAlterTest extends BrowserTestBase {
* @see locale_library_alter()
*/
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->assertTrue(array_key_exists('core/modules/locale/locale.datepicker.js', $js_assets), 'locale.datepicker.js added to scripts.');
$this->assertArrayHasKey('core/modules/locale/locale.datepicker.js', $js_assets);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment