LanguageNegotiationTest.php

Same filename in this branch
  1. 11.x core/modules/language/tests/src/Unit/process/LanguageNegotiationTest.php
Same filename in other branches
  1. 9 core/modules/language/tests/src/Unit/process/LanguageNegotiationTest.php
  2. 9 core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTest.php
  3. 8.9.x core/modules/language/tests/src/Unit/process/LanguageNegotiationTest.php
  4. 8.9.x core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTest.php
  5. 10 core/modules/language/tests/src/Unit/process/LanguageNegotiationTest.php
  6. 10 core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTest.php

Namespace

Drupal\language_test\Plugin\LanguageNegotiation

File

core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\language_test\Plugin\LanguageNegotiation;

use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\language\Attribute\LanguageNegotiation;
use Drupal\language\LanguageNegotiationMethodBase;
use Symfony\Component\HttpFoundation\Request;

/**
 * Class for identifying language from a selected language.
 */
class LanguageNegotiationTest extends LanguageNegotiationMethodBase {
    
    /**
     * The language negotiation method id.
     */
    const METHOD_ID = 'test_language_negotiation_method';
    
    /**
     * {@inheritdoc}
     */
    public function getLangcode(?Request $request = NULL) {
        return 'it';
    }

}

Classes

Title Deprecated Summary
LanguageNegotiationTest Class for identifying language from a selected language.

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