function MoveTest::testInvalidStreamWrapper

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

Tests for an invalid stream wrapper.

@covers ::move

File

core/modules/file/tests/src/Kernel/MoveTest.php, line 209

Class

MoveTest
Tests the file move function.

Namespace

Drupal\Tests\file\Kernel

Code

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

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