function FieldTypeCategoriesIntegrationTest::testLibrariesLoaded

Same name and namespace in other branches
  1. 11.x core/modules/field_ui/tests/src/Functional/FieldTypeCategoriesIntegrationTest.php \Drupal\Tests\field_ui\Functional\FieldTypeCategoriesIntegrationTest::testLibrariesLoaded()

Tests if the libraries are loaded on FieldStorageAddForm.

File

core/modules/field_ui/tests/src/Functional/FieldTypeCategoriesIntegrationTest.php, line 46

Class

FieldTypeCategoriesIntegrationTest
Tests field UI integration with field type categories for loading libraries.

Namespace

Drupal\Tests\field_ui\Functional

Code

public function testLibrariesLoaded() : void {
  $this->drupalGet('admin/structure/types/manage/' . $this->drupalCreateContentType()
    ->id() . '/fields/add-field');
  $settings = $this->getDrupalSettings();
  $css_libraries = [
    'file/drupal.file-icon',
    'text/drupal.text-icon',
    'options/drupal.options-icon',
    'comment/drupal.comment-icon',
    'link/drupal.link-icon',
  ];
  $libraries = explode(',', $settings['ajaxPageState']['libraries']);
  foreach ($css_libraries as $css_library) {
    $this->assertContains($css_library, $libraries);
  }
}

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