1 ajax.test AJAXFrameworkTestCase::testLazyLoadOverriddenCSS()

Tests that overridden CSS files are not added during lazy load.

File

core/modules/simpletest/tests/ajax.test, line 186
Ajax Tests.

Class

AJAXFrameworkTestCase
Tests primary Ajax framework functions.

Code

function testLazyLoadOverriddenCSS() {
  // The test theme overrides system.css without an implementation,
  // thereby removing it.
  theme_enable(array('test_theme'));
  config_set('system.core', 'theme_default', 'test_theme');

  // This gets the form, and emulates an Ajax submission on it, including
  // adding markup to the HEAD and BODY for any lazy loaded JS/CSS files.
  $this->backdropPostAJAX('ajax_forms_test_lazy_load_form', array('add_files' => TRUE), array('op' => t('Submit')));

  // Verify that the resulting HTML does not load the overridden CSS file.
  // We add a "?" to the assertion, because Backdrop.settings may include
  // information about the file; we only really care about whether it appears
  // in a LINK or STYLE tag, for which Backdrop always adds a query string for
  // cache control.
  $this->assertNoText('system.css?', 'Ajax lazy loading does not add overridden CSS files.');
}