function ManageFieldsTest::testFieldStorageFormAlter

Tests hook_form_field_storage_config_form_edit_alter().

@group legacy

File

core/modules/field_ui/tests/src/Functional/ManageFieldsTest.php, line 332

Class

ManageFieldsTest
Tests the Manage Display page of a fieldable entity type.

Namespace

Drupal\Tests\field_ui\Functional

Code

public function testFieldStorageFormAlter() : void {
    $this->container
        ->get('module_installer')
        ->install([
        'field_ui_test_deprecated',
    ]);
    $this->rebuildContainer();
    $node_type = $this->drupalCreateContentType();
    $bundle = $node_type->id();
    $this->expectDeprecation('The deprecated alter hook hook_form_field_storage_config_edit_form_alter() is implemented in these functions: field_ui_test_deprecated_form_field_storage_config_edit_form_alter. Use hook_form_field_config_edit_form_alter() instead. See https://www.drupal.org/node/3386675.');
    $this->drupalGet("/admin/structure/types/manage/{$bundle}/fields/node.{$bundle}.body");
    $this->assertSession()
        ->elementTextContains('css', '#edit-field-storage', 'Greetings from the field_storage_config_edit_form() alter.');
}

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