class ConfigurableLanguageManagerTest in Drupal 10
Same name in this branch
- 10 core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php \Drupal\Tests\language\Functional\ConfigurableLanguageManagerTest
- 10 core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php \Drupal\Tests\language\Kernel\ConfigurableLanguageManagerTest
Same name and namespace in other branches
- 8 core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php \Drupal\Tests\language\Kernel\ConfigurableLanguageManagerTest
- 9 core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php \Drupal\Tests\language\Kernel\ConfigurableLanguageManagerTest
Tests the ConfigurableLanguage entity.
@group language @coversDefaultClass \Drupal\language\ConfigurableLanguageManager
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \PHPUnit\Framework\TestCase implements ServiceProviderInterface uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, AssertContentTrait, ConfigTestTrait, ExtensionListTestTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings
- class \Drupal\Tests\language\Kernel\LanguageTestBase
- class \Drupal\Tests\language\Kernel\ConfigurableLanguageManagerTest
- class \Drupal\Tests\language\Kernel\LanguageTestBase
Expanded class hierarchy of ConfigurableLanguageManagerTest
File
- core/
modules/ language/ tests/ src/ Kernel/ ConfigurableLanguageManagerTest.php, line 14
Namespace
Drupal\Tests\language\KernelView source
class ConfigurableLanguageManagerTest extends LanguageTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'user',
];
/**
* The language negotiator.
*
* @var \Drupal\language\LanguageNegotiatorInterface
*/
protected $languageNegotiator;
/**
* The language manager.
*
* @var \Drupal\language\ConfigurableLanguageManagerInterface
*/
protected $languageManager;
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this
->installEntitySchema('user');
$this->languageNegotiator = $this->container
->get('language_negotiator');
$this->languageManager = $this->container
->get('language_manager');
}
/**
* @covers ::getLanguageSwitchLinks
*/
public function testLanguageSwitchLinks() {
$this->languageNegotiator
->setCurrentUser($this
->prophesize('Drupal\\Core\\Session\\AccountInterface')
->reveal());
$this->languageManager
->getLanguageSwitchLinks(LanguageInterface::TYPE_INTERFACE, new Url('<current>'));
}
}