function CopyTest::testInvalidStreamWrapper

Same name and namespace in other branches
  1. 9 core/modules/file/tests/src/Kernel/CopyTest.php \Drupal\Tests\file\Kernel\CopyTest::testInvalidStreamWrapper()
  2. 11.x core/modules/file/tests/src/Kernel/CopyTest.php \Drupal\Tests\file\Kernel\CopyTest::testInvalidStreamWrapper()

Tests for an invalid stream wrapper.

@covers ::copy

File

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

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.