class MockFileTransfer
Mock FileTransfer object to test the settings form functionality.
Hierarchy
- class \Drupal\system_test\MockFileTransfer uses \Drupal\Core\StringTranslation\StringTranslationTrait
Expanded class hierarchy of MockFileTransfer
File
-
core/
modules/ system/ tests/ modules/ system_test/ src/ MockFileTransfer.php, line 12
Namespace
Drupal\system_testView source
class MockFileTransfer {
use StringTranslationTrait;
/**
* 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' => $this->t('System Test Username'),
];
return $form;
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary | Overrides |
|---|---|---|---|---|
| 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. | |
| StringTranslationTrait::$stringTranslation | protected | property | The string translation service. | 3 |
| StringTranslationTrait::formatPlural | protected | function | Formats a string containing a count of items. | |
| StringTranslationTrait::getNumberOfPlurals | protected | function | Returns the number of plurals supported by a given language. | |
| StringTranslationTrait::getStringTranslation | protected | function | Gets the string translation service. | |
| StringTranslationTrait::setStringTranslation | public | function | Sets the string translation service to use. | 2 |
| StringTranslationTrait::t | protected | function | Translates a string to the current language or to a given language. | 1 |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.