diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-06-05 13:18:09 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-06-05 13:18:09 +0000 |
commit | 15bca6e4623e0344c4165b5e9ac6f4502e6f2481 (patch) | |
tree | eeef66305263aee2569ea3b63754864e5fb1a421 /modules/simpletest/tests/form.test | |
parent | d99623f8a1cc6b2845a40ab1f4cc8f6e57bbd056 (diff) | |
download | brdo-15bca6e4623e0344c4165b5e9ac6f4502e6f2481.tar.gz brdo-15bca6e4623e0344c4165b5e9ac6f4502e6f2481.tar.bz2 |
- Patch #803212 by effulgentsia, Heine: protection against forgery of input selection value doesn't work with checkboxes.
Diffstat (limited to 'modules/simpletest/tests/form.test')
-rw-r--r-- | modules/simpletest/tests/form.test | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test index 2cba9863a..fb46d94e5 100644 --- a/modules/simpletest/tests/form.test +++ b/modules/simpletest/tests/form.test @@ -207,6 +207,19 @@ class FormsTestCase extends DrupalWebTestCase { } } } + + /** + * Test Form API protections against input forgery. + * + * @see _form_test_input_forgery() + */ + function testInputForgery() { + $this->drupalGet('form-test/input-forgery'); + $checkbox = $this->xpath('//input[@name="checkboxes[two]"]'); + $checkbox[0]['value'] = 'FORGERY'; + $this->drupalPost(NULL, array('checkboxes[one]' => TRUE, 'checkboxes[two]' => TRUE), t('Submit')); + $this->assertText('An illegal choice has been detected.', t('Input forgery was detected.')); + } } /** |