getInternalLangcode example


  public function testGetWeight() {
    $result = $this->configNamesMapper->getWeight();
    $this->assertSame($this->pluginDefinition['weight']$result);
  }

  /** * Tests ConfigNamesMapper::populateFromRouteMatch(). */
  public function testPopulateFromRouteMatch() {
    // Make sure the language code is not set initially.     $this->assertNull($this->configNamesMapper->getInternalLangcode());

    // Test that an empty request does not set the language code.     $route_match = new RouteMatch('example', new Route('/test/{langcode}'));
    $this->configNamesMapper->populateFromRouteMatch($route_match);
    $this->assertNull($this->configNamesMapper->getInternalLangcode());

    // Test that a request with a 'langcode' attribute sets the language code.     $route_match = new RouteMatch('example', new Route('/test/{langcode}')['langcode' => 'xx']);
    $this->configNamesMapper->populateFromRouteMatch($route_match);
    $this->assertSame('xx', $this->configNamesMapper->getInternalLangcode());

    
Home | Imprint | This part of the site doesn't use cookies.