You are here

public function ConfigTranslationUiThemeTest::testThemeDiscovery in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/config_translation/src/Tests/ConfigTranslationUiThemeTest.php \Drupal\config_translation\Tests\ConfigTranslationUiThemeTest::testThemeDiscovery()

Tests that theme provided *.config_translation.yml files are found.

File

core/modules/config_translation/src/Tests/ConfigTranslationUiThemeTest.php, line 62
Contains \Drupal\config_translation\Tests\ConfigTranslationUiThemeTest.

Class

ConfigTranslationUiThemeTest
Verifies theme configuration translation settings.

Namespace

Drupal\config_translation\Tests

Code

public function testThemeDiscovery() {

  // Install the test theme and rebuild routes.
  $theme = 'config_translation_test_theme';
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet('admin/appearance');
  $elements = $this
    ->xpath('//a[normalize-space()=:label and contains(@href, :theme)]', [
    ':label' => 'Install and set as default',
    ':theme' => $theme,
  ]);
  $this
    ->drupalGet($GLOBALS['base_root'] . $elements[0]['href'], [
    'external' => TRUE,
  ]);
  $translation_base_url = 'admin/config/development/performance/translate';
  $this
    ->drupalGet($translation_base_url);
  $this
    ->assertResponse(200);
  $this
    ->assertLinkByHref("{$translation_base_url}/fr/add");
}