function CKEditorStylesComboTranslationTest::testExistingFormat
Tests translations of CKEditor styles configuration.
File
- 
              core/modules/ ckeditor/ tests/ src/ Functional/ CKEditorStylesComboTranslationTest.php, line 79 
Class
- CKEditorStylesComboTranslationTest
- Tests administration of the CKEditor StylesCombo plugin.
Namespace
Drupal\Tests\ckeditor\FunctionalCode
public function testExistingFormat() {
  $this->drupalLogin($this->adminUser);
  $edit = [
    'editor[settings][plugins][stylescombo][styles]' => 'h1.title|Title',
  ];
  $this->drupalGet('admin/config/content/formats/manage/' . $this->format);
  $this->submitForm($edit, 'Save configuration');
  $this->drupalGet('admin/config/content/formats/manage/' . $this->format . '/translate/de/add');
  $this->assertEquals('textarea', $this->assertSession()
    ->fieldExists('List of styles')
    ->getTagName());
  $this->assertSession()
    ->fieldValueEquals('List of styles', 'h1.title|Title');
  $page = $this->getSession()
    ->getPage();
  $page->fillField('List of styles', 'h1.title|Titel');
  $page->pressButton('Save translation');
  $this->assertSession()
    ->pageTextContains('Successfully saved German translation.');
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
