Version 1
[yaffs-website] / web / core / modules / update / tests / modules / update_test / src / TestFileTransferWithSettingsForm.php
1 <?php
2
3 namespace Drupal\update_test;
4
5 use Drupal\Core\FileTransfer\Local;
6
7 /**
8  * Provides an object to test the settings form functionality.
9  *
10  * This class extends \Drupal\Core\FileTransfer\Local to make module install
11  * testing via \Drupal\Core\FileTransfer\Form\FileTransferAuthorizeForm and
12  * authorize.php possible.
13  *
14  * @see \Drupal\update\Tests\FileTransferAuthorizeFormTest
15  */
16 class TestFileTransferWithSettingsForm extends Local {
17
18   /**
19    * Returns a Drupal\update_test\TestFileTransferWithSettingsForm object.
20    *
21    * @return \Drupal\update_test\TestFileTransferWithSettingsForm
22    *   A new Drupal\update_test\TestFileTransferWithSettingsForm object.
23    */
24   public static function factory($jail, $settings) {
25     return new static($jail);
26   }
27
28   /**
29    * Returns a settings form with a text field to input a username.
30    */
31   public function getSettingsForm() {
32     $form = [];
33     $form['update_test_username'] = [
34       '#type' => 'textfield',
35       '#title' => t('Update Test Username'),
36     ];
37     return $form;
38   }
39
40 }