function TestFileTransfer::connect

Connects to the server.

Overrides FileTransfer::connect

File

drupal/core/modules/system/lib/Drupal/system/Tests/FileTransfer/TestFileTransfer.php, line 35
Definition of Drupal\system\Tests\FileTransfer\TestFileTransfer.

Class

TestFileTransfer
Mock FileTransfer object for test case.

Namespace

Drupal\system\Tests\FileTransfer

Code

function connect() {
  $parts = explode(':', $this->hostname);
  $port = count($parts) == 2 ? $parts[1] : $this->port;
  $this->connection = new MockTestConnection();
  $this->connection->connectionString = 'test://' . urlencode($this->username) . ':' . urlencode($this->password) . "@{$this->host}:{$this->port}/";
}