function TestFileTransfer::connect

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/FileTransfer/TestFileTransfer.php \Drupal\Tests\system\Functional\FileTransfer\TestFileTransfer::connect()
  2. 8.9.x core/modules/system/tests/src/Functional/FileTransfer/TestFileTransfer.php \Drupal\Tests\system\Functional\FileTransfer\TestFileTransfer::connect()
  3. 10 core/modules/system/tests/src/Functional/FileTransfer/TestFileTransfer.php \Drupal\Tests\system\Functional\FileTransfer\TestFileTransfer::connect()
  4. 11.x core/modules/system/tests/src/Functional/FileTransfer/TestFileTransfer.php \Drupal\Tests\system\Functional\FileTransfer\TestFileTransfer::connect()

Overrides FileTransfer::connect

File

modules/simpletest/tests/filetransfer.test, line 114

Class

TestFileTransfer
Mock FileTransfer object for test case.

Code

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

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