class MockFileTransfer

Same name in other branches
  1. 9 core/modules/system/tests/modules/system_test/src/MockFileTransfer.php \Drupal\system_test\MockFileTransfer
  2. 10 core/modules/system/tests/modules/system_test/src/MockFileTransfer.php \Drupal\system_test\MockFileTransfer
  3. 11.x core/modules/system/tests/modules/system_test/src/MockFileTransfer.php \Drupal\system_test\MockFileTransfer

Mock FileTransfer object to test the settings form functionality.

Hierarchy

Expanded class hierarchy of MockFileTransfer

File

core/modules/system/tests/modules/system_test/src/MockFileTransfer.php, line 8

Namespace

Drupal\system_test
View source
class MockFileTransfer {
    
    /**
     * Returns a Drupal\system_test\MockFileTransfer object.
     *
     * @return \Drupal\system_test\MockFileTransfer
     *   A new Drupal\system_test\MockFileTransfer object.
     */
    public static function factory() {
        return new MockFileTransfer();
    }
    
    /**
     * Returns a settings form with a text field to input a username.
     */
    public function getSettingsForm() {
        $form = [];
        $form['system_test_username'] = [
            '#type' => 'textfield',
            '#title' => t('System Test Username'),
        ];
        return $form;
    }

}

Members

Title Sort descending Modifiers Object type Summary
MockFileTransfer::factory public static function Returns a Drupal\system_test\MockFileTransfer object.
MockFileTransfer::getSettingsForm public function Returns a settings form with a text field to input a username.

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