You are here

public function FileSystemTest::testSuccessfulCopy in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/File/FileSystemTest.php \Drupal\KernelTests\Core\File\FileSystemTest::testSuccessfulCopy()
  2. 9 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 97

Class

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

Namespace

Drupal\KernelTests\Core\File

Code

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