class TestFileTransferWithSettingsForm

Same name and namespace in other branches
  1. 11.x core/modules/update/tests/modules/update_test/src/TestFileTransferWithSettingsForm.php \Drupal\update_test\TestFileTransferWithSettingsForm
  2. 10 core/modules/update/tests/modules/update_test/src/TestFileTransferWithSettingsForm.php \Drupal\update_test\TestFileTransferWithSettingsForm
  3. 8.9.x core/modules/update/tests/modules/update_test/src/TestFileTransferWithSettingsForm.php \Drupal\update_test\TestFileTransferWithSettingsForm

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.

Hierarchy

Expanded class hierarchy of TestFileTransferWithSettingsForm

See also

\Drupal\update\Tests\FileTransferAuthorizeFormTest

File

core/modules/update/tests/modules/update_test/src/TestFileTransferWithSettingsForm.php, line 16

Namespace

Drupal\update_test
View source
class TestFileTransferWithSettingsForm extends Local {
  
  /**
   * Returns a Drupal\update_test\TestFileTransferWithSettingsForm object.
   *
   * @return static
   *   A new Drupal\update_test\TestFileTransferWithSettingsForm object.
   */
  public static function factory($jail, $settings) {
    return new static($jail, \Drupal::service('file_system'));
  }
  
  /**
   * 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;
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.