function FileTransferTest::testJail

Tests the file transfer jail.

File

core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php, line 92

Class

FileTransferTest
Tests recursive file copy operations with the file transfer jail.

Namespace

Drupal\Tests\system\Functional\FileTransfer

Code

public function testJail() : void {
  $source = $this->_buildFakeModule();
  $this->testConnection
    ->copyDirectory($source, $this->root . '/' . PublicStream::basePath());
  $this->expectException(FileTransferException::class);
  $this->expectExceptionMessage('@directory is outside of the @jail');
  $this->testConnection
    ->copyDirectory($source, sys_get_temp_dir());
}

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