@trigger_error('file_default_scheme() is deprecated in drupal:8.8.0. It will be removed from drupal:9.0.0. Use \Drupal::config(\'system.file\')->get(\'default_scheme\') instead. See https://www.drupal.org/project/paragraphs/issues/3049030',E_USER_DEPRECATED);
\Drupal::logger('file')->notice('The data could not be saved because the destination %destination is invalid. This may be caused by improper use of file_save_data() or a missing stream wrapper.',['%destination'=>$destination]);
$this->assertEqual(file_default_scheme(),file_uri_scheme($result->getFileUri()),"File was placed in Drupal's files directory.");
$this->assertEqual(\Drupal::config('system.file')->get('default_scheme'),file_uri_scheme($result->getFileUri()),"File was placed in Drupal's files directory.");
$this->assertEqual($result->getFilename(),\Drupal::service('file_system')->basename($result->getFileUri()),"Filename was set to the file's basename.");
$this->assertEqual($contents,file_get_contents($result->getFileUri()),'Contents of the file are correct.');
$this->assertEqual($result->getMimeType(),'application/octet-stream','A MIME type was set.');
$this->assertTrue(\Drupal::service('file_system')->delete(file_default_scheme().'/'.$this->randomMachineName()),'Returns true when deleting a non-existent file.');
$this->assertTrue(\Drupal::service('file_system')->delete('public://'.$this->randomMachineName()),'Returns true when deleting a non-existent file.');
@@ -162,4 +162,11 @@ public function testUnlink() {
$this->assertFileNotExists($uri);
}
/**
* @expectedDeprecation file_default_scheme() is deprecated in drupal:8.8.0. It will be removed from drupal:9.0.0. Use \Drupal::config('system.file')->get('default_scheme') instead. See https://www.drupal.org/project/paragraphs/issues/3049030