public function testReuseExistingField() { $path = 'admin/structure/types/manage/article';
$path2 = 'admin/structure/types/manage/page';
$this->
drupalGet($path2 . '/fields'
);
// The button should not be visible without any re-usable fields.
$this->
assertSession()->
linkNotExists('Re-use an existing field'
);
$field_label = 'Test field';
// Create a field, and a node with some data for the field.
$this->
fieldUIAddNewFieldJS($path, 'test',
$field_label);
// Add an existing field.
$this->
fieldUIAddExistingFieldJS($path2, 'field_test',
$field_label);
// Confirm the button is no longer visible after re-using the field.
$this->
assertSession()->
linkNotExists('Re-use an existing field'
);
} /**
* Tests filter results in the re-use form.
*/
public function testFilterInReuseForm() { $session =
$this->
getSession();
$page =
$session->
getPage();
$path = 'admin/structure/types/manage/article';