update
This commit is contained in:
@@ -60,7 +60,7 @@ class EntityDisplayModeTest extends BrowserTestBase {
|
||||
$this->assertSession()->statusCodeEquals(404);
|
||||
|
||||
$this->drupalGet('admin/structure/display-modes/view/add');
|
||||
$this->assertNoLink(t('Test entity - revisions and data table'), 'An entity type with no view builder cannot have view modes.');
|
||||
$this->assertSession()->linkNotExists(t('Test entity - revisions and data table'), 'An entity type with no view builder cannot have view modes.');
|
||||
|
||||
// Test adding a view mode including dots in machine_name.
|
||||
$this->clickLink(t('Test entity'));
|
||||
@@ -114,7 +114,7 @@ class EntityDisplayModeTest extends BrowserTestBase {
|
||||
$this->assertSession()->statusCodeEquals(404);
|
||||
|
||||
$this->drupalGet('admin/structure/display-modes/form/add');
|
||||
$this->assertNoLink(t('Entity Test without label'), 'An entity type with no form cannot have form modes.');
|
||||
$this->assertSession()->linkNotExists(t('Entity Test without label'), 'An entity type with no form cannot have form modes.');
|
||||
|
||||
// Test adding a view mode including dots in machine_name.
|
||||
$this->clickLink(t('Test entity'));
|
||||
|
||||
@@ -54,7 +54,17 @@ class FieldUIDeleteTest extends BrowserTestBase {
|
||||
$this->drupalPlaceBlock('page_title_block');
|
||||
|
||||
// Create a test user.
|
||||
$admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer users', 'administer account settings', 'administer user display', 'bypass node access']);
|
||||
$admin_user = $this->drupalCreateUser([
|
||||
'access content',
|
||||
'administer content types',
|
||||
'administer node fields',
|
||||
'administer node form display',
|
||||
'administer node display',
|
||||
'administer users',
|
||||
'administer account settings',
|
||||
'administer user display',
|
||||
'bypass node access',
|
||||
]);
|
||||
$this->drupalLogin($admin_user);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,11 @@ class FieldUIIndentationTest extends BrowserTestBase {
|
||||
parent::setUp();
|
||||
|
||||
// Create a test user.
|
||||
$admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node display']);
|
||||
$admin_user = $this->drupalCreateUser([
|
||||
'access content',
|
||||
'administer content types',
|
||||
'administer node display',
|
||||
]);
|
||||
$this->drupalLogin($admin_user);
|
||||
|
||||
// Create Basic page node type.
|
||||
|
||||
@@ -87,7 +87,7 @@ class FieldUIRouteTest extends BrowserTestBase {
|
||||
|
||||
$edit = ['display_modes_custom[test]' => TRUE];
|
||||
$this->drupalPostForm('admin/config/people/accounts/display', $edit, t('Save'));
|
||||
$this->assertLink('Test');
|
||||
$this->assertSession()->linkExists('Test');
|
||||
|
||||
// Create new form mode and verify it's available on the Manage Form
|
||||
// Display screen after enabling it.
|
||||
@@ -100,17 +100,17 @@ class FieldUIRouteTest extends BrowserTestBase {
|
||||
|
||||
$edit = ['display_modes_custom[test]' => TRUE];
|
||||
$this->drupalPostForm('admin/config/people/accounts/form-display', $edit, t('Save'));
|
||||
$this->assertLink('Test');
|
||||
$this->assertSession()->linkExists('Test');
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that local tasks exists.
|
||||
*/
|
||||
public function assertLocalTasks() {
|
||||
$this->assertLink('Settings');
|
||||
$this->assertLink('Manage fields');
|
||||
$this->assertLink('Manage display');
|
||||
$this->assertLink('Manage form display');
|
||||
$this->assertSession()->linkExists('Settings');
|
||||
$this->assertSession()->linkExists('Manage fields');
|
||||
$this->assertSession()->linkExists('Manage display');
|
||||
$this->assertSession()->linkExists('Manage form display');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,7 +49,20 @@ class ManageDisplayTest extends BrowserTestBase {
|
||||
$this->drupalPlaceBlock('local_tasks_block');
|
||||
|
||||
// Create a test user.
|
||||
$admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer taxonomy', 'administer taxonomy_term fields', 'administer taxonomy_term display', 'administer users', 'administer account settings', 'administer user display', 'bypass node access']);
|
||||
$admin_user = $this->drupalCreateUser([
|
||||
'access content',
|
||||
'administer content types',
|
||||
'administer node fields',
|
||||
'administer node form display',
|
||||
'administer node display',
|
||||
'administer taxonomy',
|
||||
'administer taxonomy_term fields',
|
||||
'administer taxonomy_term display',
|
||||
'administer users',
|
||||
'administer account settings',
|
||||
'administer user display',
|
||||
'bypass node access',
|
||||
]);
|
||||
$this->drupalLogin($admin_user);
|
||||
|
||||
// Create content type, with underscores.
|
||||
@@ -149,12 +162,12 @@ class ManageDisplayTest extends BrowserTestBase {
|
||||
public function testViewModeLocalTasks() {
|
||||
$manage_display = 'admin/structure/types/manage/' . $this->type . '/display';
|
||||
$this->drupalGet($manage_display);
|
||||
$this->assertNoLink('Full content');
|
||||
$this->assertLink('Teaser');
|
||||
$this->assertSession()->linkNotExists('Full content');
|
||||
$this->assertSession()->linkExists('Teaser');
|
||||
|
||||
$this->drupalGet($manage_display . '/teaser');
|
||||
$this->assertNoLink('Full content');
|
||||
$this->assertLink('Default');
|
||||
$this->assertSession()->linkNotExists('Full content');
|
||||
$this->assertSession()->linkExists('Default');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -225,6 +238,7 @@ class ManageDisplayTest extends BrowserTestBase {
|
||||
* Plain text to look for.
|
||||
* @param $message
|
||||
* Message to display.
|
||||
*
|
||||
* @return
|
||||
* TRUE on pass, FALSE on fail.
|
||||
*/
|
||||
|
||||
@@ -81,7 +81,20 @@ class ManageFieldsFunctionalTest extends BrowserTestBase {
|
||||
$this->drupalPlaceBlock('page_title_block');
|
||||
|
||||
// Create a test user.
|
||||
$admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer taxonomy', 'administer taxonomy_term fields', 'administer taxonomy_term display', 'administer users', 'administer account settings', 'administer user display', 'bypass node access']);
|
||||
$admin_user = $this->drupalCreateUser([
|
||||
'access content',
|
||||
'administer content types',
|
||||
'administer node fields',
|
||||
'administer node form display',
|
||||
'administer node display',
|
||||
'administer taxonomy',
|
||||
'administer taxonomy_term fields',
|
||||
'administer taxonomy_term display',
|
||||
'administer users',
|
||||
'administer account settings',
|
||||
'administer user display',
|
||||
'bypass node access',
|
||||
]);
|
||||
$this->drupalLogin($admin_user);
|
||||
|
||||
// Create content type, with underscores.
|
||||
@@ -158,7 +171,7 @@ class ManageFieldsFunctionalTest extends BrowserTestBase {
|
||||
}
|
||||
|
||||
// Test the "Add field" action link.
|
||||
$this->assertLink('Add field');
|
||||
$this->assertSession()->linkExists('Add field');
|
||||
|
||||
// Assert entity operations for all fields.
|
||||
$number_of_links = 3;
|
||||
@@ -278,9 +291,9 @@ class ManageFieldsFunctionalTest extends BrowserTestBase {
|
||||
$this->assertFieldByXPath("//input[@name='cardinality_number']", 6);
|
||||
|
||||
// Check that tabs displayed.
|
||||
$this->assertLink(t('Edit'));
|
||||
$this->assertSession()->linkExists(t('Edit'));
|
||||
$this->assertLinkByHref('admin/structure/types/manage/article/fields/node.article.body');
|
||||
$this->assertLink(t('Field settings'));
|
||||
$this->assertSession()->linkExists(t('Field settings'));
|
||||
$this->assertLinkByHref($field_edit_path);
|
||||
|
||||
// Add two entries in the body.
|
||||
|
||||
@@ -51,7 +51,17 @@ class ManageDisplayTest extends WebDriverTestBase {
|
||||
$this->drupalPlaceBlock('system_breadcrumb_block');
|
||||
|
||||
// Create a test user.
|
||||
$admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer users', 'administer account settings', 'administer user display', 'bypass node access']);
|
||||
$admin_user = $this->drupalCreateUser([
|
||||
'access content',
|
||||
'administer content types',
|
||||
'administer node fields',
|
||||
'administer node form display',
|
||||
'administer node display',
|
||||
'administer users',
|
||||
'administer account settings',
|
||||
'administer user display',
|
||||
'bypass node access',
|
||||
]);
|
||||
$this->drupalLogin($admin_user);
|
||||
|
||||
// Create content type, with underscores.
|
||||
|
||||
@@ -47,7 +47,7 @@ trait FieldUiTestTrait {
|
||||
$this->drupalPostForm($bundle_path, $initial_edit, t('Save and continue'));
|
||||
$this->assertRaw(t('These settings apply to the %label field everywhere it is used.', ['%label' => $label]), 'Storage settings page was displayed.');
|
||||
// Test Breadcrumbs.
|
||||
$this->assertLink($label, 0, 'Field label is correct in the breadcrumb of the storage settings page.');
|
||||
$this->assertSession()->linkExists($label, 0, 'Field label is correct in the breadcrumb of the storage settings page.');
|
||||
|
||||
// Second step: 'Storage settings' form.
|
||||
$this->drupalPostForm(NULL, $storage_edit, t('Save field settings'));
|
||||
@@ -115,7 +115,7 @@ trait FieldUiTestTrait {
|
||||
$this->assertRaw(t('Are you sure you want to delete the field %label', ['%label' => $label]), 'Delete confirmation was found.');
|
||||
|
||||
// Test Breadcrumbs.
|
||||
$this->assertLink($label, 0, 'Field label is correct in the breadcrumb of the field delete page.');
|
||||
$this->assertSession()->linkExists($label, 0, 'Field label is correct in the breadcrumb of the field delete page.');
|
||||
|
||||
// Submit confirmation form.
|
||||
$this->drupalPostForm(NULL, [], t('Delete'));
|
||||
|
||||
Reference in New Issue
Block a user