Issue #3068022 by kim.pepper: Properly deprecate drupal_realpath()

merge-requests/55/head
catch 2019-07-18 11:49:52 +01:00
parent c8af78eb6d
commit 442a3f224a
2 changed files with 8 additions and 0 deletions

View File

@ -1121,6 +1121,7 @@ function drupal_unlink($uri, $context = NULL) {
* @see https://www.drupal.org/node/2418133
*/
function drupal_realpath($uri) {
@trigger_error('drupal_realpath() is deprecated in drupal:8.0.0 and will be removed in drupal:9.0.0. Use \Drupal\Core\File\FileSystemInterface::realpath(). See https://www.drupal.org/node/2418133.', E_USER_DEPRECATED);
return \Drupal::service('file_system')->realpath($uri);
}

View File

@ -252,4 +252,11 @@ class FileSystemDeprecationTest extends KernelTestBase {
return $data;
}
/**
* @expectedDeprecation drupal_realpath() is deprecated in drupal:8.0.0 and will be removed in drupal:9.0.0. Use \Drupal\Core\File\FileSystemInterface::realpath(). See https://www.drupal.org/node/2418133.
*/
public function testRealpath() {
$this->assertNotEmpty(drupal_realpath('public://'));
}
}