You are here

function ConfigEntityListMultilingualTest::testListUI in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/config/src/Tests/ConfigEntityListMultilingualTest.php \Drupal\config\Tests\ConfigEntityListMultilingualTest::testListUI()

Tests the listing UI with different language scenarios.

File

core/modules/config/src/Tests/ConfigEntityListMultilingualTest.php, line 42
Contains \Drupal\config\Tests\ConfigEntityListMultilingualTest.

Class

ConfigEntityListMultilingualTest
Tests the listing of configuration entities in a multilingual scenario.

Namespace

Drupal\config\Tests

Code

function testListUI() {

  // Log in as an administrative user to access the full menu trail.
  $this
    ->drupalLogin($this
    ->drupalCreateUser(array(
    'access administration pages',
    'administer site configuration',
  )));

  // Get the list page.
  $this
    ->drupalGet('admin/structure/config_test');
  $this
    ->assertLinkByHref('admin/structure/config_test/manage/dotted.default');

  // Add a new entity using the action link.
  $this
    ->clickLink('Add test configuration');
  $edit = array(
    'label' => 'Antilop',
    'id' => 'antilop',
    'langcode' => 'hu',
  );
  $this
    ->drupalPostForm(NULL, $edit, t('Save'));

  // Ensure that operations for editing the Hungarian entity appear in English.
  $this
    ->assertLinkByHref('admin/structure/config_test/manage/antilop');

  // Get the list page in Hungarian and assert Hungarian admin links
  // regardless of language of config entities.
  $this
    ->drupalGet('hu/admin/structure/config_test');
  $this
    ->assertLinkByHref('hu/admin/structure/config_test/manage/dotted.default');
  $this
    ->assertLinkByHref('hu/admin/structure/config_test/manage/antilop');
}