1 common.test public CommonJavaScriptTestCase::testAssetsAttachedViaHookTheme()

Tests the addition of assets via hook_theme(). These are all random assets that would not normally be added to the page.

See also

common_test_theme()

File

core/modules/simpletest/tests/common.test, line 1925
Tests for common.inc functionality.

Class

CommonJavaScriptTestCase
Tests for the JavaScript system.

Code

public function testAssetsAttachedViaHookTheme() {
  $config = config('system.core');
  $config->set('preprocess_css', FALSE);
  $config->set('preprocess_js', FALSE);
  $config->save();
  $this->backdropGet('common-test/assets-attached-via-hook-theme');
  $this->assertRaw('core/themes/basis/css/component/maintenance.css', 'CSS attached via hook_theme() is added to the page.');
  $this->assertRaw('core/themes/seven/js/script.js', 'JS attached via hook_theme() is added to the page.');
  $this->assertRaw('"globe-stand-fill":"\/core\/misc\/icons\/globe-stand-fill.svg"', 'Icon attached via hook_theme() is added to the page.');
  $this->assertRaw('core/misc/ajax.js', 'Library attached via hook_theme() is added to the page.');
}