class LegacyExtensionPathResolverTest
Tests the extension path resolver deprecations.
@group legacy @group Module
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\Extension\LegacyExtensionPathResolverTest extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of LegacyExtensionPathResolverTest
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Extension/ LegacyExtensionPathResolverTest.php, line 18
Namespace
Drupal\KernelTests\Core\ExtensionView source
class LegacyExtensionPathResolverTest extends KernelTestBase {
/**
* @group legacy
*/
public function testDeprecatedWarning() {
$this->expectDeprecation('Calling getPathname() with an invalid $type parameter is deprecated in drupal:9.3.0 and will throw an \\Drupal\\Core\\Extension\\Exception\\UnknownExtensionTypeException in drupal:10.0.0. See https://www.drupal.org/node/2940438');
$module_extension_list = $this->prophesize(ModuleExtensionList::class);
$profile_extension_list = $this->prophesize(ProfileExtensionList::class);
$theme_extension_list = $this->prophesize(ThemeExtensionList::class);
$theme_engine_extension_list = $this->prophesize(ThemeEngineExtensionList::class);
$resolver = new ExtensionPathResolver($module_extension_list->reveal(), $profile_extension_list->reveal(), $theme_extension_list->reveal(), $theme_engine_extension_list->reveal());
$this->assertEmpty($resolver->getPath('foo', 'bar'));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.