Version 1
[yaffs-website] / web / core / modules / update / tests / modules / update_test / src / TestFileTransferWithSettingsForm.php
diff --git a/web/core/modules/update/tests/modules/update_test/src/TestFileTransferWithSettingsForm.php b/web/core/modules/update/tests/modules/update_test/src/TestFileTransferWithSettingsForm.php
new file mode 100644 (file)
index 0000000..4afcade
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+namespace Drupal\update_test;
+
+use Drupal\Core\FileTransfer\Local;
+
+/**
+ * Provides an object to test the settings form functionality.
+ *
+ * This class extends \Drupal\Core\FileTransfer\Local to make module install
+ * testing via \Drupal\Core\FileTransfer\Form\FileTransferAuthorizeForm and
+ * authorize.php possible.
+ *
+ * @see \Drupal\update\Tests\FileTransferAuthorizeFormTest
+ */
+class TestFileTransferWithSettingsForm extends Local {
+
+  /**
+   * Returns a Drupal\update_test\TestFileTransferWithSettingsForm object.
+   *
+   * @return \Drupal\update_test\TestFileTransferWithSettingsForm
+   *   A new Drupal\update_test\TestFileTransferWithSettingsForm object.
+   */
+  public static function factory($jail, $settings) {
+    return new static($jail);
+  }
+
+  /**
+   * Returns a settings form with a text field to input a username.
+   */
+  public function getSettingsForm() {
+    $form = [];
+    $form['update_test_username'] = [
+      '#type' => 'textfield',
+      '#title' => t('Update Test Username'),
+    ];
+    return $form;
+  }
+
+}