// Check "Re-use existing field" appears.
$this->
drupalGet('admin/structure/types/manage/page/fields'
);
$this->
assertSession()->
pageTextContains('Re-use an existing field'
);
$this->
clickLink('Re-use an existing field'
);
// Check that fields of other entity types (here, the 'comment_body' field)
// do not show up in the "Re-use existing field" list.
$this->
assertSession()->
elementNotExists('css', '.js-reuse-table [data-field-id="comment_body"]'
);
// Validate the FALSE assertion above by also testing a valid one.
$this->
assertSession()->
elementExists('css', ".js-reuse-table [data-field-id='{
$this->fieldName
}']"
);
$new_label =
$this->fieldLabel . '_2';
// Add a new field based on an existing field.
$this->
fieldUIAddExistingField("admin/structure/types/manage/page",
$this->fieldName,
$new_label);
} /**
* Tests the cardinality settings of a field.
*
* We do not test if the number can be submitted with anything else than a
* numeric value. That is tested already in FormTest::testNumber().
*/
public function cardinalitySettings() { $field_edit_path = 'admin/structure/types/manage/article/fields/node.article.body/storage';