function CKEditor5Test::testPathsToFormNames

Same name and namespace in other branches
  1. 10 core/modules/ckeditor5/tests/src/Unit/CKEditor5Test.php \Drupal\Tests\ckeditor5\Unit\CKEditor5Test::testPathsToFormNames()
  2. 11.x core/modules/ckeditor5/tests/src/Unit/CKEditor5Test.php \Drupal\Tests\ckeditor5\Unit\CKEditor5Test::testPathsToFormNames()

@covers \Drupal\ckeditor5\Plugin\Editor\CKEditor5::mapViolationPropertyPathsToFormNames @dataProvider providerPathsToFormNames

File

core/modules/ckeditor5/tests/src/Unit/CKEditor5Test.php, line 46

Class

CKEditor5Test
@coversDefaultClass <a href="/api/drupal/core%21modules%21ckeditor5%21src%21Plugin%21Editor%21CKEditor5.php/class/CKEditor5/9" title="Defines a CKEditor 5-based text editor for Drupal." class="local">\Drupal\ckeditor5\Plugin\Editor\CKEditor5</a> @group ckeditor5 @internal

Namespace

Drupal\Tests\ckeditor5\Unit

Code

public function testPathsToFormNames(string $property_path, string $expected_form_item_name, bool $expect_exception = FALSE) : void {
    $mapMethod = self::getMethod(CKEditor5::class, 'mapViolationPropertyPathsToFormNames');
    if ($expect_exception) {
        $this->expectExceptionMessage('assert($shifted === \'settings\')');
    }
    $form_item_name = $mapMethod->invokeArgs(NULL, [
        $property_path,
        static::SIMULATED_FORM_STRUCTURE,
    ]);
    if (!$expect_exception) {
        $this->assertSame($expected_form_item_name, $form_item_name);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.