function FileSystemTest::testSuccessfulCopy
Same name and namespace in other branches
- 8.9.x core/tests/Drupal/KernelTests/Core/File/FileSystemTest.php \Drupal\KernelTests\Core\File\FileSystemTest::testSuccessfulCopy()
- 10 core/tests/Drupal/KernelTests/Core/File/FileSystemTest.php \Drupal\KernelTests\Core\File\FileSystemTest::testSuccessfulCopy()
- 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 97
Class
- FileSystemTest
- @coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21File%21FileSystem.php/class/FileSystem/9" title="Provides helpers to operate on files and stream wrappers." class="local">\Drupal\Core\File\FileSystem</a> @group File
Namespace
Drupal\KernelTests\Core\FileCode
public function testSuccessfulCopy() {
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.