From 0259ee968ffa4db893e57a80931aaf9f8ae69e5e Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 27 Aug 2009 04:40:12 +0000 Subject: #367567 by effulgentsia, yched, quicksketch, sun, and chx: Move AHAH-'add more' to the new generic AHAH callback, and add support for form definition functions being kept in non-.module files. --- modules/field/field.test | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'modules/field/field.test') diff --git a/modules/field/field.test b/modules/field/field.test index 6f7607f8c..d1a717ba5 100644 --- a/modules/field/field.test +++ b/modules/field/field.test @@ -1375,8 +1375,7 @@ class FieldFormTestCase extends FieldTestCase { $pattern[$weight] = "]*value=\"$value\" [^>]*"; } // Press 'add more' button through AHAH. - $path = 'field/js_add_more/' . str_replace('_', '-', $this->instance['bundle']) . '/' . str_replace('_', '-', $this->instance['field_name']); - $this->_fieldPostAhah($path, $edit, t('Add another item')); + $this->_fieldPostAhah($edit, t('Add another item')); ksort($values); $values = array_values($values); @@ -1401,11 +1400,8 @@ class FieldFormTestCase extends FieldTestCase { * Since the result is generally not a full-fledged form, this cannot be * called iteratively. */ - function _fieldPostAhah($path, $edit, $submit, array $options = array(), array $headers = array()) { - // @TODO: the framework should make it possible to submit a form to a - // different URL than its action or the current. For now, we can just force - // it. - $this->additionalCurlOptions[CURLOPT_URL] = url($path, array('absolute' => TRUE)); + function _fieldPostAhah($edit, $submit, array $options = array(), array $headers = array()) { + $this->additionalCurlOptions[CURLOPT_URL] = url('system/ajax', array('absolute' => TRUE)); $this->drupalPost(NULL, $edit, $submit); unset($this->additionalCurlOptions[CURLOPT_URL]); -- cgit v1.2.3