function FileSystemTest::testSuccessfulCopy

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/File/FileSystemTest.php \Drupal\KernelTests\Core\File\FileSystemTest::testSuccessfulCopy()
  2. 8.9.x core/tests/Drupal/KernelTests/Core/File/FileSystemTest.php \Drupal\KernelTests\Core\File\FileSystemTest::testSuccessfulCopy()
  3. 11.x core/tests/Drupal/KernelTests/Core/File/FileSystemTest.php \Drupal\KernelTests\Core\File\FileSystemTest::testSuccessfulCopy()

@covers ::copy

File

core/tests/Drupal/KernelTests/Core/File/FileSystemTest.php, line 99

Class

FileSystemTest
@coversDefaultClass \Drupal\Core\File\FileSystem @group File

Namespace

Drupal\KernelTests\Core\File

Code

public function testSuccessfulCopy() : void {
    touch('public://test.txt');
    $this->fileSystem
        ->copy('public://test.txt', 'public://test-copy.txt');
    $this->assertFileExists('public://test-copy.txt');
}

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