diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2011-01-03 02:41:33 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2011-01-03 02:41:33 +0000 |
commit | 81f6ecd362f279a0e1c468bff68c98ea2571bd2e (patch) | |
tree | a7ae0a7fe26f937cc6501adad014646edbb7088c /modules/update/tests | |
parent | bfcdaf0607a563d69380f21602ae0d95c00f0402 (diff) | |
download | brdo-81f6ecd362f279a0e1c468bff68c98ea2571bd2e.tar.gz brdo-81f6ecd362f279a0e1c468bff68c98ea2571bd2e.tar.bz2 |
#686060 by Crell, David_Rothstein, dww, yoroy, carlos8f, et al: Fixed Explain that the Update manager only works if you have FTP or SSH access to your server
Diffstat (limited to 'modules/update/tests')
-rw-r--r-- | modules/update/tests/update_test.module | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/modules/update/tests/update_test.module b/modules/update/tests/update_test.module index 9b8de5b45..fb7d3abfb 100644 --- a/modules/update/tests/update_test.module +++ b/modules/update/tests/update_test.module @@ -112,3 +112,40 @@ function update_test_archiver_info() { ), ); } + +/** + * Implements hook_filetransfer_info(). + */ +function update_test_filetransfer_info() { + // Define a mock file transfer method, to ensure that there will always be + // at least one method available in the user interface (regardless of the + // environment in which the update manager tests are run). + return array( + 'system_test' => array( + 'title' => t('Update Test FileTransfer'), + // This should be in an .inc file, but for testing purposes, it is OK to + // leave it in the main module file. + 'file' => 'update_test.module', + 'class' => 'UpdateTestFileTransfer', + 'weight' => -20, + ), + ); +} + +/** + * Mock FileTransfer object to test the settings form functionality. + */ +class UpdateTestFileTransfer { + public static function factory() { + return new UpdateTestFileTransfer; + } + + public function getSettingsForm() { + $form = array(); + $form['udpate_test_username'] = array( + '#type' => 'textfield', + '#title' => t('Update Test Username'), + ); + return $form; + } +} |