You are here

class TestFileTransferWithSettingsForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/update/tests/modules/update_test/src/TestFileTransferWithSettingsForm.php \Drupal\update_test\TestFileTransferWithSettingsForm
  2. 9 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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property
DependencySerializationTrait::$_serviceIds protected property
DependencySerializationTrait::__sleep public function 2
DependencySerializationTrait::__wakeup public function 2
FileTransfer::$hostname protected property The hostname for this file transfer.
FileTransfer::$password protected property The password for this file transfer. 1
FileTransfer::$port protected property The port for this file transfer. 1
FileTransfer::$username protected property The username for this file transfer. 1
FileTransfer::checkPath final protected function Checks that the path is inside the jail and throws an exception if not.
FileTransfer::chmod final public function Changes the permissions of the specified $path (file or directory).
FileTransfer::copyDirectory final public function Copies a directory.
FileTransfer::copyDirectoryJailed protected function Copies a directory.
FileTransfer::copyFile final public function Copies a file.
FileTransfer::createDirectory final public function Creates a directory.
FileTransfer::findChroot public function Returns the chroot property for this connection.
FileTransfer::fixRemotePath final protected function Returns a modified path suitable for passing to the server.
FileTransfer::removeDirectory final public function Removes a directory.
FileTransfer::removeFile final public function Removes a file.
FileTransfer::sanitizePath public function Changes backslashes to slashes, also removes a trailing slash.
FileTransfer::setChroot public function Sets the chroot and changes the jail to match the correct path scheme.
FileTransfer::__get public function Implements the magic __get() method.
Local::$fileSystem protected property The file system service.
Local::chmodJailed public function Changes the permissions of the file / directory specified in $path. Overrides ChmodInterface::chmodJailed
Local::connect public function Connects to the server. Overrides FileTransfer::connect
Local::copyFileJailed protected function Copies a file. Overrides FileTransfer::copyFileJailed
Local::createDirectoryJailed protected function Creates a directory. Overrides FileTransfer::createDirectoryJailed
Local::isDirectory public function Checks if a particular path is a directory. Overrides FileTransfer::isDirectory
Local::isFile public function Checks if a particular path is a file (not a directory). Overrides FileTransfer::isFile
Local::removeDirectoryJailed protected function Removes a directory. Overrides FileTransfer::removeDirectoryJailed
Local::removeFileJailed protected function Removes a file. Overrides FileTransfer::removeFileJailed
Local::__construct public function Constructs a Drupal\Core\FileTransfer\FileTransfer object. Overrides FileTransfer::__construct
TestFileTransferWithSettingsForm::factory public static function Returns a Drupal\update_test\TestFileTransferWithSettingsForm object. Overrides Local::factory
TestFileTransferWithSettingsForm::getSettingsForm public function Returns a settings form with a text field to input a username. Overrides FileTransfer::getSettingsForm