class CKEditor5UpdateAlignmentTest
Tests the update path for CKEditor 5 alignment.
@group Update
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\FunctionalTests\Update\UpdatePathTestBase uses \Drupal\Tests\UpdatePathTestTrait implements \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\ckeditor5\Functional\Update\CKEditor5UpdateAlignmentTest uses \Drupal\Tests\ckeditor5\Traits\CKEditor5TestTrait implements \Drupal\FunctionalTests\Update\UpdatePathTestBase
- class \Drupal\FunctionalTests\Update\UpdatePathTestBase uses \Drupal\Tests\UpdatePathTestTrait implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of CKEditor5UpdateAlignmentTest
File
-
core/
modules/ ckeditor5/ tests/ src/ Functional/ Update/ CKEditor5UpdateAlignmentTest.php, line 14
Namespace
Drupal\Tests\ckeditor5\Functional\UpdateView source
class CKEditor5UpdateAlignmentTest extends UpdatePathTestBase {
use CKEditor5TestTrait;
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-9.3.0.bare.standard.php.gz',
__DIR__ . '/../../../fixtures/update/ckeditor5-3259593.php',
];
}
/**
* Tests update of individual button that are alignment configuration.
*/
public function testUpdateAlignmentButtons() {
$editor = Editor::load('test_format');
$settings = $editor->getSettings();
$this->assertContains('alignment:center', $settings['toolbar']['items']);
$this->runUpdates();
$expected_toolbar_items = [
'link',
'bold',
'italic',
'sourceEditing',
'alignment',
];
$expected_alignment_plugin = [
'enabled_alignments' => [
'center',
],
];
$editor = Editor::load('test_format');
$settings = $editor->getSettings();
$this->assertEquals($expected_toolbar_items, $settings['toolbar']['items']);
$this->assertEquals($expected_alignment_plugin, $settings['plugins']['ckeditor5_alignment']);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.