function LegacyFileSystemTest::testCopyWithOutOfBoundsIntPositive

Same name and namespace in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/File/LegacyFileSystemTest.php \Drupal\KernelTests\Core\File\LegacyFileSystemTest::testCopyWithOutOfBoundsIntPositive()

@covers ::copy

File

core/tests/Drupal/KernelTests/Core/File/LegacyFileSystemTest.php, line 79

Class

LegacyFileSystemTest
Tests the legacy file system functions.

Namespace

Drupal\KernelTests\Core\File

Code

public function testCopyWithOutOfBoundsIntPositive() : void {
    $uri = 'public://test.txt';
    $destination = 'public://test2.txt';
    touch($uri);
    $this->expectDeprecation('Passing the $fileExists argument as an integer to Drupal\\Core\\File\\FileSystem::copy() is deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. Use \\Drupal\\Core\\File\\FileExists enum instead. See https://www.drupal.org/node/3426517');
    $this->fileSystem
        ->copy($uri, $destination, \PHP_INT_MAX);
}

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