Issue #3068022 by kim.pepper: Properly deprecate drupal_realpath()
parent
c8af78eb6d
commit
442a3f224a
|
@ -1121,6 +1121,7 @@ function drupal_unlink($uri, $context = NULL) {
|
||||||
* @see https://www.drupal.org/node/2418133
|
* @see https://www.drupal.org/node/2418133
|
||||||
*/
|
*/
|
||||||
function drupal_realpath($uri) {
|
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);
|
return \Drupal::service('file_system')->realpath($uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -252,4 +252,11 @@ class FileSystemDeprecationTest extends KernelTestBase {
|
||||||
return $data;
|
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://'));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue