You are here

public function ConfigTranslationDateFormatUiTest::testDateFormatUI in Zircon Profile 8

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

Tests date format translation behaviour.

File

core/modules/config_translation/src/Tests/ConfigTranslationDateFormatUiTest.php, line 45
Contains \Drupal\config_translation\Tests\ConfigTranslationDateFormatUiTest.

Class

ConfigTranslationDateFormatUiTest
Tests the content translation behaviours on date formats.

Namespace

Drupal\config_translation\Tests

Code

public function testDateFormatUI() {
  $this
    ->drupalGet('admin/config/regional/date-time');

  // Assert translation link unlocked date format.
  $this
    ->assertLinkByHref('admin/config/regional/date-time/formats/manage/medium/translate');

  // Assert translation link locked date format.
  $this
    ->assertLinkByHref('admin/config/regional/date-time/formats/manage/html_datetime/translate');

  // Date pattern is visible on unlocked date formats.
  $this
    ->drupalGet('admin/config/regional/date-time/formats/manage/medium/translate/de/add');
  $this
    ->assertField('translation[config_names][core.date_format.medium][pattern]');

  // Date pattern is not visible on locked date formats.
  $this
    ->drupalGet('admin/config/regional/date-time/formats/manage/html_datetime/translate/es/add');
  $this
    ->assertNoField('translation[config_names][core.date_format.html_datetime][pattern]');
}