ConfigurableLanguageManagerTest.php

Same filename in this branch
  1. 9 core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php
Same filename in other branches
  1. 8.9.x core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php
  2. 8.9.x core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php
  3. 10 core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php
  4. 10 core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php
  5. 11.x core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php
  6. 11.x core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php

Namespace

Drupal\Tests\language\Kernel

File

core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php

View source
<?php

namespace Drupal\Tests\language\Kernel;

use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Url;

/**
 * Tests the ConfigurableLanguage entity.
 *
 * @group language
 * @coversDefaultClass \Drupal\language\ConfigurableLanguageManager
 */
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>'));
    }

}

Classes

Title Deprecated Summary
ConfigurableLanguageManagerTest Tests the ConfigurableLanguage entity.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.