1 common.test CommonJavaScriptTestCase::testVersionQueryString()

Test JavaScript versioning.

File

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

Class

CommonJavaScriptTestCase
Tests for the JavaScript system.

Code

function testVersionQueryString() {
  backdrop_add_js('core/misc/collapse.js', array('version' => 'foo'));
  backdrop_add_js('core/misc/ajax.js', array('version' => 'bar'));
  $javascript = backdrop_get_js();
  $this->assertTrue(strpos($javascript, 'core/misc/collapse.js?v=foo') > 0 && strpos($javascript, 'core/misc/ajax.js?v=bar') > 0, t('JavaScript version identifiers correctly appended to URLs'));
}