function ManageFieldsTest::testFieldDropButtonOperations

Same name and namespace in other branches
  1. 8.9.x core/modules/field_ui/tests/src/Functional/ManageFieldsTest.php \Drupal\Tests\field_ui\Functional\ManageFieldsTest::testFieldDropButtonOperations()
  2. 10 core/modules/field_ui/tests/src/Functional/ManageFieldsTest.php \Drupal\Tests\field_ui\Functional\ManageFieldsTest::testFieldDropButtonOperations()
  3. 11.x core/modules/field_ui/tests/src/Functional/ManageFieldsTest.php \Drupal\Tests\field_ui\Functional\ManageFieldsTest::testFieldDropButtonOperations()

File

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

Class

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

Namespace

Drupal\Tests\field_ui\Functional

Code

public function testFieldDropButtonOperations() {
    $node_type = $this->drupalCreateContentType();
    
    /** @var \Drupal\field\FieldStorageConfigInterface $storage */
    $storage = $this->container
        ->get('entity_type.manager')
        ->getStorage('field_storage_config')
        ->create([
        'type' => 'string',
        'field_name' => 'highlander',
        'entity_type' => 'node',
    ]);
    $storage->save();
    $this->container
        ->get('entity_type.manager')
        ->getStorage('field_config')
        ->create([
        'field_storage' => $storage,
        'bundle' => $node_type->id(),
    ])
        ->save();
    $this->drupalGet('/admin/structure/types/manage/' . $node_type->id() . '/fields');
}

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