diff --git a/core/includes/file.inc b/core/includes/file.inc index 1ef9bd2bca..438fe671c0 100644 --- a/core/includes/file.inc +++ b/core/includes/file.inc @@ -839,8 +839,8 @@ function file_delete($fid) { * file usages instead. That will automatically mark the file as temporary and * remove it during cleanup. * - * @param $fid - * The file id. + * @param $fids + * An array of file ids. * * @deprecated in Drupal 8.7.0, will be removed before Drupal 9.0.0. * Use \Drupal\Core\Entity\EntityStorageInterface::delete() instead. diff --git a/core/modules/file/tests/src/Kernel/FileLegacyTest.php b/core/modules/file/tests/src/Kernel/FileLegacyTest.php index 47a3c7076f..f55139c805 100644 --- a/core/modules/file/tests/src/Kernel/FileLegacyTest.php +++ b/core/modules/file/tests/src/Kernel/FileLegacyTest.php @@ -46,4 +46,18 @@ public function testFileUrlDeprecation() { $this->assertEquals($file->createFileUrl(FALSE), $file->url()); } + /** + * @expectedDeprecation file_delete() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityStorageInterface::delete() instead. See https://www.drupal.org/node/3021663. + */ + public function testDeprecatedFileDelete() { + $this->assertNull(file_delete('')); + } + + /** + * @expectedDeprecation file_delete_multiple() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityStorageInterface::delete() instead. See https://www.drupal.org/node/3021663. + */ + public function testDeprecatedFileDeleteMultiple() { + $this->assertNull(file_delete_multiple([''])); + } + } diff --git a/core/tests/Drupal/KernelTests/Core/File/FileSystemDeprecationTest.php b/core/tests/Drupal/KernelTests/Core/File/FileSystemDeprecationTest.php deleted file mode 100644 index 1207272dd2..0000000000 --- a/core/tests/Drupal/KernelTests/Core/File/FileSystemDeprecationTest.php +++ /dev/null @@ -1,43 +0,0 @@ -assertNotNull(drupal_move_uploaded_file('', '')); - } - - /** - * @expectedDeprecation file_delete() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityStorageInterface::delete() instead. See https://www.drupal.org/node/3021663. - */ - public function testDeprecatedFileDelete() { - $this->assertNull(file_delete('')); - } - - /** - * @expectedDeprecation file_delete_multiple() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityStorageInterface::delete() instead. See https://www.drupal.org/node/3021663. - */ - public function testDeprecatedFileDeleteMultiple() { - $this->assertNull(file_delete_multiple([''])); - } - -} diff --git a/core/tests/Drupal/Tests/Core/File/FileSystemDeprecationTest.php b/core/tests/Drupal/Tests/Core/File/FileSystemDeprecationTest.php new file mode 100644 index 0000000000..9a55e57e49 --- /dev/null +++ b/core/tests/Drupal/Tests/Core/File/FileSystemDeprecationTest.php @@ -0,0 +1,29 @@ +assertNotNull(drupal_move_uploaded_file('', '')); + } + +}