diff -u b/core/tests/Drupal/KernelTests/Core/File/UnmanagedCopyTest.php b/core/tests/Drupal/KernelTests/Core/File/UnmanagedCopyTest.php --- b/core/tests/Drupal/KernelTests/Core/File/UnmanagedCopyTest.php +++ b/core/tests/Drupal/KernelTests/Core/File/UnmanagedCopyTest.php @@ -86,9 +86,9 @@ $this->assertFilePermissions($new_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); // Copy the file into a subdirectory that does not exist. - $new_filepath = file_unmanaged_copy($uri, drupal_dirname($uri) . '/sub/' . drupal_basename($uri), FILE_EXISTS_ERROR); + $new_filepath = file_unmanaged_copy($uri, \Drupal::service('file_system')->dirname($uri) . '/sub/' . \Drupal::service('file_system')->basename($uri), FILE_EXISTS_ERROR); $this->assertTrue($new_filepath, 'Copying into same directory works.'); - $this->assertNotEqual($new_filepath, $uri, 'Copied file has a new name.'); + self::assertNotEquals($new_filepath, $uri, 'Copied file has a new name.'); $this->assertTrue(file_exists($uri), 'Original file exists after copying onto itself.'); $this->assertTrue(file_exists($new_filepath), 'Copied file exists after copying onto itself.'); $this->assertFilePermissions($new_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); diff -u b/core/tests/Drupal/KernelTests/Core/File/UnmanagedMoveTest.php b/core/tests/Drupal/KernelTests/Core/File/UnmanagedMoveTest.php --- b/core/tests/Drupal/KernelTests/Core/File/UnmanagedMoveTest.php +++ b/core/tests/Drupal/KernelTests/Core/File/UnmanagedMoveTest.php @@ -40,9 +40,9 @@ // Moving the file into a subdirectory that does not exist. $desired_filepath = 'public://sub/' . $this->randomMachineName(); - $newest_filepath= file_unmanaged_move($newer_filepath, $desired_filepath, FILE_EXISTS_ERROR); + $newest_filepath = file_unmanaged_move($newer_filepath, $desired_filepath, FILE_EXISTS_ERROR); $this->assertTrue($newest_filepath, 'Move was successful.'); - $this->assertEqual($newest_filepath, $desired_filepath, 'Returned expected filepath.'); + self::assertEquals($newest_filepath, $desired_filepath, 'Returned expected filepath.'); $this->assertTrue(file_exists($newest_filepath), 'File exists at the new location.'); $this->assertFalse(file_exists($newer_filepath), 'No file remains at the old location.'); $this->assertFilePermissions($newest_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE));