You are here

function AJAXFrameworkTestCase::testAJAXRender in SimpleTest 7

Test proper passing of JavaScript settings via ajax_render().

File

tests/ajax.test, line 29

Class

AJAXFrameworkTestCase
Tests primary AJAX framework functions.

Code

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

  // Verify that JavaScript settings are contained (always first).
  $this
    ->assertIdentical($result[0]['command'], 'settings', t('drupal_add_js() settings are contained first.'));

  // Verify that basePath is contained in JavaScript settings.
  $this
    ->assertEqual($result[0]['settings']['basePath'], base_path(), t('Base path is contained in JavaScript settings.'));
}