function TestFileTransfer::connect
Establishes a mock connection for file transfer.
Overrides FileTransfer::connect
File
-
core/
modules/ system/ tests/ src/ Functional/ FileTransfer/ TestFileTransfer.php, line 52
Class
- TestFileTransfer
- Mock FileTransfer object for test case.
Namespace
Drupal\Tests\system\Functional\FileTransferCode
public function connect() {
// @phpstan-ignore property.deprecatedClass
$this->connection = new MockTestConnection();
// Access the connection via the property. The property used to be set via a
// magic method and this can cause problems if coded incorrectly.
// @phpstan-ignore property.deprecatedClass
$this->connection->connectionString = 'test://' . urlencode($this->username) . ':' . urlencode($this->password) . "@{$this->host}:{$this->port}/";
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.