function LinksetControllerMultiLingualTest::testBasicMultilingualFunctions

Same name in other branches
  1. 10 core/modules/system/tests/src/Functional/Menu/LinksetControllerMultiLingualTest.php \Drupal\Tests\system\Functional\Menu\LinksetControllerMultiLingualTest::testBasicMultilingualFunctions()

Test core functions of the linkset for multilingual behavior.

Throws

\Exception

File

core/modules/system/tests/src/Functional/Menu/LinksetControllerMultiLingualTest.php, line 204

Class

LinksetControllerMultiLingualTest
Tests the behavior of the linkset controller in multilingual setup.

Namespace

Drupal\Tests\system\Functional\Menu

Code

public function testBasicMultilingualFunctions() : void {
    foreach ([
        'aa',
        'bb',
        'cc',
        'dd',
    ] as $language_code) {
        $expected_linkset = $this->getReferenceLinksetDataFromFile(__DIR__ . '/../../../fixtures/linkset/linkset-menu-main-multilingual-' . $language_code . '.json');
        $response = $this->doRequest('GET', Url::fromUri('base:/' . $language_code . '/system/menu/main/linkset'));
        $this->assertSame($expected_linkset, Json::decode((string) $response->getBody()));
    }
}

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