1 ajax.test AJAXFrameworkTestCase::testAJAXRender()

Test that ajax_render() returns JavaScript settings generated during the page request.

@todo Add tests to ensure that ajax_render() returns commands for new CSS and JavaScript files to be loaded by the page. See http://drupal.org/node/561858.

File

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

Class

AJAXFrameworkTestCase
Tests primary Ajax framework functions.

Code

function testAJAXRender() {
  $commands = $this->backdropGetAJAX('ajax-test/render');

  // Verify that there is a command to load settings added with
  // backdrop_add_js().
  $expected = array(
    'command' => 'settings',
    'settings' => array('basePath' => base_path(), 'ajax' => 'test'),
  );
  $this->assertCommand($commands, $expected, t('ajax_render() loads settings added with backdrop_add_js().'));
}