function JqueryUiLibraryAssetsTest::providerTestAssetLoading

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Libraries/JqueryUiLibraryAssetsTest.php \Drupal\FunctionalTests\Libraries\JqueryUiLibraryAssetsTest::providerTestAssetLoading()
  2. 11.x core/tests/Drupal/FunctionalTests/Libraries/JqueryUiLibraryAssetsTest.php \Drupal\FunctionalTests\Libraries\JqueryUiLibraryAssetsTest::providerTestAssetLoading()

Data provider for confirming jQuery UI assets load as expected.

Provides arrays that list how jQuery UI CSS and JavaScript dependencies loaded prior to the change from dependencies to direct asset loading.

Return value

array An array of test cases, where each test case is an array with the following values:

  • A pipe delimited string of the library/libraries to test.
  • An array of the jQuery UI CSS files that loaded for a given library prior to the change from jQuery UI library dependencies to direct file inclusion.
  • An array of the jQuery UI JavaScript files that loaded for a given library prior to the change from jQuery UI library dependencies to direct file inclusion.

File

core/tests/Drupal/FunctionalTests/Libraries/JqueryUiLibraryAssetsTest.php, line 349

Class

JqueryUiLibraryAssetsTest
Tests the loading of jQuery UI CSS and JS assets.

Namespace

Drupal\FunctionalTests\Libraries

Code

public static function providerTestAssetLoading() {
    return [
        'drupal.autocomplete' => [
            'library' => 'drupal.autocomplete',
            'expected_css' => [
                'core/assets/vendor/jquery.ui/themes/base/core.css',
                'core/assets/vendor/jquery.ui/themes/base/menu.css',
                'core/assets/vendor/jquery.ui/themes/base/autocomplete.css',
                'core/assets/vendor/jquery.ui/themes/base/theme.css',
            ],
            'expected_js' => [
                'core/assets/vendor/jquery.ui/ui/data-min.js',
                'core/assets/vendor/jquery.ui/ui/disable-selection-min.js',
                'core/assets/vendor/jquery.ui/ui/form-min.js',
                'core/assets/vendor/jquery.ui/ui/labels-min.js',
                'core/assets/vendor/jquery.ui/ui/jquery-patch-min.js',
                'core/assets/vendor/jquery.ui/ui/scroll-parent-min.js',
                'core/assets/vendor/jquery.ui/ui/unique-id-min.js',
                'core/assets/vendor/jquery.ui/ui/version-min.js',
                'core/assets/vendor/jquery.ui/ui/focusable-min.js',
                'core/assets/vendor/jquery.ui/ui/ie-min.js',
                'core/assets/vendor/jquery.ui/ui/keycode-min.js',
                'core/assets/vendor/jquery.ui/ui/plugin-min.js',
                'core/assets/vendor/jquery.ui/ui/safe-active-element-min.js',
                'core/assets/vendor/jquery.ui/ui/safe-blur-min.js',
                'core/assets/vendor/jquery.ui/ui/widget-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/menu-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/autocomplete-min.js',
            ],
        ],
        'drupal.dialog' => [
            'library' => 'drupal.dialog',
            'expected_css' => [
                'core/assets/vendor/jquery.ui/themes/base/core.css',
                'core/assets/vendor/jquery.ui/themes/base/resizable.css',
                'core/assets/vendor/jquery.ui/themes/base/checkboxradio.css',
                'core/assets/vendor/jquery.ui/themes/base/controlgroup.css',
                'core/assets/vendor/jquery.ui/themes/base/button.css',
                'core/assets/vendor/jquery.ui/themes/base/dialog.css',
                'core/assets/vendor/jquery.ui/themes/base/theme.css',
            ],
            'expected_js' => [
                'core/assets/vendor/jquery.ui/ui/data-min.js',
                'core/assets/vendor/jquery.ui/ui/disable-selection-min.js',
                'core/assets/vendor/jquery.ui/ui/form-min.js',
                'core/assets/vendor/jquery.ui/ui/labels-min.js',
                'core/assets/vendor/jquery.ui/ui/jquery-patch-min.js',
                'core/assets/vendor/jquery.ui/ui/scroll-parent-min.js',
                'core/assets/vendor/jquery.ui/ui/unique-id-min.js',
                'core/assets/vendor/jquery.ui/ui/version-min.js',
                'core/assets/vendor/jquery.ui/ui/focusable-min.js',
                'core/assets/vendor/jquery.ui/ui/keycode-min.js',
                'core/assets/vendor/jquery.ui/ui/plugin-min.js',
                'core/assets/vendor/jquery.ui/ui/safe-active-element-min.js',
                'core/assets/vendor/jquery.ui/ui/safe-blur-min.js',
                'core/assets/vendor/jquery.ui/ui/widget-min.js',
                'core/assets/vendor/jquery.ui/ui/ie-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/mouse-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/draggable-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/resizable-min.js',
                'core/assets/vendor/jquery.ui/ui/form-reset-mixin-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/checkboxradio-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/controlgroup-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/button-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/dialog-min.js',
            ],
        ],
        // A few instances of multiple libraries being checked simultaneously are
        // here to ensure that multiple libraries requesting the same asset does
        // not impact the expected loading order.
'drupal.autocomplete|drupal.dialog' => [
            'library' => 'drupal.autocomplete|drupal.dialog',
            'expected_css' => [
                'core/assets/vendor/jquery.ui/themes/base/core.css',
                'core/assets/vendor/jquery.ui/themes/base/menu.css',
                'core/assets/vendor/jquery.ui/themes/base/autocomplete.css',
                'core/assets/vendor/jquery.ui/themes/base/resizable.css',
                'core/assets/vendor/jquery.ui/themes/base/checkboxradio.css',
                'core/assets/vendor/jquery.ui/themes/base/controlgroup.css',
                'core/assets/vendor/jquery.ui/themes/base/button.css',
                'core/assets/vendor/jquery.ui/themes/base/dialog.css',
                'core/assets/vendor/jquery.ui/themes/base/theme.css',
            ],
            'expected_js' => [
                'core/assets/vendor/jquery.ui/ui/data-min.js',
                'core/assets/vendor/jquery.ui/ui/disable-selection-min.js',
                'core/assets/vendor/jquery.ui/ui/form-min.js',
                'core/assets/vendor/jquery.ui/ui/labels-min.js',
                'core/assets/vendor/jquery.ui/ui/jquery-patch-min.js',
                'core/assets/vendor/jquery.ui/ui/scroll-parent-min.js',
                'core/assets/vendor/jquery.ui/ui/unique-id-min.js',
                'core/assets/vendor/jquery.ui/ui/version-min.js',
                'core/assets/vendor/jquery.ui/ui/focusable-min.js',
                'core/assets/vendor/jquery.ui/ui/keycode-min.js',
                'core/assets/vendor/jquery.ui/ui/plugin-min.js',
                'core/assets/vendor/jquery.ui/ui/safe-active-element-min.js',
                'core/assets/vendor/jquery.ui/ui/safe-blur-min.js',
                'core/assets/vendor/jquery.ui/ui/widget-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/menu-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/autocomplete-min.js',
                'core/assets/vendor/jquery.ui/ui/ie-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/mouse-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/draggable-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/resizable-min.js',
                'core/assets/vendor/jquery.ui/ui/form-reset-mixin-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/checkboxradio-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/controlgroup-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/button-min.js',
                'core/assets/vendor/jquery.ui/ui/widgets/dialog-min.js',
            ],
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.