From f8b63338e48a6b0ef52e024030b0330c0fc8af53 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 13 Sep 2010 01:09:26 +0000 Subject: - Patch #756762 by effulgentsia, fago, sun, rfay, pwolanin: AJAX should follow same rules for whether to call drupal_rebuild_form() as non-AJAX submissions. --- modules/simpletest/tests/form.test | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/simpletest/tests') 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.')); -- cgit v1.2.3