You are here

class ConfigurableLanguageManagerTest in Drupal 10

Same name in this branch
  1. 10 core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php \Drupal\Tests\language\Functional\ConfigurableLanguageManagerTest
  2. 10 core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php \Drupal\Tests\language\Kernel\ConfigurableLanguageManagerTest
Same name and namespace in other branches
  1. 8 core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php \Drupal\Tests\language\Kernel\ConfigurableLanguageManagerTest
  2. 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

Expanded class hierarchy of ConfigurableLanguageManagerTest

File

core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php, line 14

Namespace

Drupal\Tests\language\Kernel
View 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>'));
  }

}

Members