Commit 7aeffa40 authored by catch's avatar catch
Browse files

Issue #3553853 by smustgrave, amateescu: Change placeholder type for text_textarea schema

(cherry picked from commit 219b00ec)
parent 027c0bfd
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ field.widget.settings.text_textarea:
      type: integer
      label: 'Rows'
    placeholder:
      type: label
      type: text
      label: 'Placeholder'

field.widget.settings.text_textarea_with_summary:
+41 −1
Original line number Diff line number Diff line
@@ -65,7 +65,47 @@ protected function setUp(): void {
  /**
   * Tests validation of entity form display component's widget settings.
   */
  public function testMultilineTextFieldWidgetPlaceholder(): void {
  public function testMultilineTextFieldWidgetTextAreaPlaceholder(): void {
    // First, create a field for which widget settings exist.
    $text_field_storage_config = FieldStorageConfig::create([
      'type' => 'text_long',
      'field_name' => 'novel',
      'entity_type' => 'user',
    ]);
    $text_field_storage_config->save();

    $text_field_config = FieldConfig::create([
      'field_storage' => $text_field_storage_config,
      'bundle' => 'user',
      'dependencies' => [
        'config' => [
          $text_field_storage_config->getConfigDependencyName(),
        ],
      ],
    ]);
    $text_field_config->save();

    // Then, configure a form display widget for this field.
    assert($this->entity instanceof EntityFormDisplayInterface);
    $this->entity->setComponent('novel', [
      'type' => 'text_textarea',
      'region' => 'content',
      'settings' => [
        'rows' => 5,
        'placeholder' => "Multi\nLine",
      ],
      'third_party_settings' => [],
    ]);

    $this->assertValidationErrors([]);
  }

  /**
   * Tests validation of entity form display component's widget settings.
   *
   * @todo move in https://www.drupal.org/project/drupal/issues/3551650.
   */
  public function testMultilineTextFieldWidgetTextAreaSummaryPlaceholder(): void {
    // First, create a field for which widget settings exist.
    $text_field_storage_config = FieldStorageConfig::create([
      'type' => 'text_with_summary',