class GetFilenameTest
Same name and namespace in other branches
- 8.9.x core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php \Drupal\KernelTests\Core\Bootstrap\GetFilenameTest
Tests that drupal_get_filename() works correctly.
@group Bootstrap @group legacy
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\KernelTests\Core\Bootstrap\GetFilenameTest extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of GetFilenameTest
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Bootstrap/ GetFilenameTest.php, line 13
Namespace
Drupal\KernelTests\Core\BootstrapView source
class GetFilenameTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'system',
];
/**
* Tests drupal_get_filename() deprecation.
*/
public function testDrupalGetFilename() : void {
$this->expectDeprecation('drupal_get_filename() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \\Drupal\\Core\\Extension\\ExtensionPathResolver::getPathname() instead. See https://www.drupal.org/node/2940438');
$this->assertEquals('core/modules/system/system.info.yml', drupal_get_filename('module', 'system'));
}
/**
* Tests drupal_get_path() deprecation.
*/
public function testDrupalGetPath() : void {
$this->expectDeprecation('drupal_get_path() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \\Drupal\\Core\\Extension\\ExtensionPathResolver::getPath() instead. See https://www.drupal.org/node/2940438');
$this->expectDeprecation('drupal_get_filename() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \\Drupal\\Core\\Extension\\ExtensionPathResolver::getPathname() instead. See https://www.drupal.org/node/2940438');
$this->assertEquals('core/modules/system', drupal_get_path('module', 'system'));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.