function CopyTest::testInvalidStreamWrapper

Tests for an invalid stream wrapper.

@covers ::copy

File

core/modules/file/tests/src/Kernel/CopyTest.php, line 186

Class

CopyTest
Tests the file copy function.

Namespace

Drupal\Tests\file\Kernel

Code

public function testInvalidStreamWrapper() {
  $this->expectException(InvalidStreamWrapperException::class);
  $this->expectExceptionMessage('Invalid stream wrapper: foo://');
  $source = $this->createFile();
  $this->fileRepository
    ->copy($source, 'foo://');
}

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