summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-09-13 01:09:26 +0000
committerDries Buytaert <dries@buytaert.net>2010-09-13 01:09:26 +0000
commitf8b63338e48a6b0ef52e024030b0330c0fc8af53 (patch)
treed411369da8a9110f6a3d715f325130e289d03713 /modules/simpletest
parent1b3c481ad151fff0fe22b1b00330c08e0244203b (diff)
downloadbrdo-f8b63338e48a6b0ef52e024030b0330c0fc8af53.tar.gz
brdo-f8b63338e48a6b0ef52e024030b0330c0fc8af53.tar.bz2
- Patch #756762 by effulgentsia, fago, sun, rfay, pwolanin: AJAX should follow same rules for whether to call drupal_rebuild_form() as non-AJAX submissions.
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/tests/form.test4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test
index d628f488b..ce4bc9681 100644
--- a/modules/simpletest/tests/form.test
+++ b/modules/simpletest/tests/form.test
@@ -1011,6 +1011,10 @@ class FormsRebuildTestCase extends DrupalWebTestCase {
$this->drupalPost(NULL, array(), t('Save'));
$this->assertText('Title field is required.', t('Non-AJAX submission correctly triggered a validation error.'));
+ // Ensure that the form contains two items in the multi-valued field, so we
+ // know we're testing a form that was correctly retrieved from cache.
+ $this->assert(count($this->xpath('//form[contains(@id, "page-node-form")]//div[contains(@class, "form-item-field-ajax-test")]//input[@type="text"]')) == 2, t('Form retained its state from cache.'));
+
// Ensure that the form's action is correct.
$forms = $this->xpath('//form[contains(@class, "node-page-form")]');
$this->assert(count($forms) == 1 && $forms[0]['action'] == url('node/add/page'), t('Re-rendered form contains the correct action value.'));