diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-17 07:12:16 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-17 07:12:16 +0000 |
commit | 25b9f686a626fc5424c36555fe4757cb8114d4ea (patch) | |
tree | 8640840732e7b9ebcdfaf15a37054714696d4c0f /modules/field/field.test | |
parent | 55d9463766e08ebaf9aa08955a418e18fd889353 (diff) | |
download | brdo-25b9f686a626fc5424c36555fe4757cb8114d4ea.tar.gz brdo-25b9f686a626fc5424c36555fe4757cb8114d4ea.tar.bz2 |
#544418 by merlinofchaos, sun, drewish, quicksketch, et al: Integrate CTools AJAX framework with Drupal to extend (and replace) existing ahah framework. Everything about AJAX/AHAH is more betterer now.
Diffstat (limited to 'modules/field/field.test')
-rw-r--r-- | modules/field/field.test | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/modules/field/field.test b/modules/field/field.test index fce0fd8c2..49a1694bf 100644 --- a/modules/field/field.test +++ b/modules/field/field.test @@ -1336,12 +1336,19 @@ class FieldFormTestCase extends DrupalWebTestCase { unset($this->additionalCurlOptions[CURLOPT_URL]); // The response is drupal_json, so we need to undo some escaping. - $response = json_decode(str_replace(array('\x3c', '\x3e', '\x26'), array("<", ">", "&"), $this->drupalGetContent())); - $this->assertTrue(is_object($response), t('The response is an object')); - $this->assertIdentical($response->status, TRUE, t('Response status is true')); + $commands = json_decode(str_replace(array('\x3c', '\x3e', '\x26'), array("<", ">", "&"), $this->drupalGetContent())); + + // The JSON response will be two AJAX commands. The first is a settings + // command and the second is the replace command. + $settings = reset($commands); + $replace = next($commands); + + $this->assertTrue(is_object($settings), t('The response settings command is an object')); + $this->assertTrue(is_object($replace), t('The response replace command is an object')); + // This response data is valid HTML so we will can reuse everything we have // for HTML pages. - $this->content = $response->data; + $this->content = $replace->data; // Needs to be emptied out so the new content will be parsed. $this->elements = ''; |