summaryrefslogtreecommitdiff
path: root/modules/file/tests
diff options
context:
space:
mode:
Diffstat (limited to 'modules/file/tests')
-rw-r--r--modules/file/tests/file.test4
-rw-r--r--modules/file/tests/file_module_test.module1
2 files changed, 5 insertions, 0 deletions
diff --git a/modules/file/tests/file.test b/modules/file/tests/file.test
index 1b5fdf5cd..7fa6d6f01 100644
--- a/modules/file/tests/file.test
+++ b/modules/file/tests/file.test
@@ -239,6 +239,10 @@ class FileManagedFileElementTestCase extends FileFieldTestCase {
* Tests the managed_file element type.
*/
function testManagedFile() {
+ // Check that $element['#size'] is passed to the child upload element.
+ $this->drupalGet('file/test');
+ $this->assertFieldByXpath('//input[@name="files[nested_file]" and @size="13"]', NULL, 'The custom #size attribute is passed to the child upload element.');
+
// Perform the tests with all permutations of $form['#tree'] and
// $element['#extended'].
foreach (array(0, 1) as $tree) {
diff --git a/modules/file/tests/file_module_test.module b/modules/file/tests/file_module_test.module
index 358c8b011..f66c749dd 100644
--- a/modules/file/tests/file_module_test.module
+++ b/modules/file/tests/file_module_test.module
@@ -36,6 +36,7 @@ function file_module_test_form($form, &$form_state, $tree = TRUE, $extended = FA
'#upload_location' => 'public://test',
'#progress_message' => t('Please wait...'),
'#extended' => (bool) $extended,
+ '#size' => 13,
);
if ($default_fid) {
$form['nested']['file']['#default_value'] = $extended ? array('fid' => $default_fid) : $default_fid;