Commit 50570ec5 authored by xjm's avatar xjm
Browse files

Issue #3133033 by munish.kumar, xjm, Hardik_Patel_12, daffie, swatichouhan012:...

Issue #3133033 by munish.kumar, xjm, Hardik_Patel_12, daffie, swatichouhan012: Fix Drupal.Array.Array.LongLineDeclaration coding standard for instances of the drupalCreateUser() test method

(cherry picked from commit de32f3ca)
parent 4d51aabe
......@@ -64,7 +64,12 @@ protected function setUp(): void {
$this->drupalPlaceBlock('page_title_block');
// Create users with specific permissions.
$this->adminUser = $this->drupalCreateUser(['administer site configuration', 'access administration pages', 'access site reports', 'administer users']);
$this->adminUser = $this->drupalCreateUser([
'administer site configuration',
'access administration pages',
'access site reports',
'administer users',
]);
$this->webUser = $this->drupalCreateUser([]);
}
......
......@@ -105,9 +105,23 @@ protected function setUp(): void {
->save();
// Create 3 users, each with access to different text formats.
$this->untrustedUser = $this->drupalCreateUser(['create article content', 'edit any article content']);
$this->normalUser = $this->drupalCreateUser(['create article content', 'edit any article content', 'use text format filtered_html']);
$this->privilegedUser = $this->drupalCreateUser(['create article content', 'edit any article content', 'create page content', 'edit any page content', 'use text format filtered_html', 'use text format full_html']);
$this->untrustedUser = $this->drupalCreateUser([
'create article content',
'edit any article content',
]);
$this->normalUser = $this->drupalCreateUser([
'create article content',
'edit any article content',
'use text format filtered_html',
]);
$this->privilegedUser = $this->drupalCreateUser([
'create article content',
'edit any article content',
'create page content',
'edit any page content',
'use text format filtered_html',
'use text format full_html',
]);
}
/**
......
......@@ -66,7 +66,10 @@ protected function setUp(): void {
])->save();
// Create admin user.
$this->adminUser = $this->drupalCreateUser(['administer filters', 'use text format basic_html']);
$this->adminUser = $this->drupalCreateUser([
'administer filters',
'use text format basic_html',
]);
$this->drupalLogin($this->adminUser);
}
......
......@@ -50,7 +50,14 @@ protected function setUp(): void {
$type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
$this->bundle = $type->id();
$admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node display', 'bypass node access', 'administer nodes']);
$admin_user = $this->drupalCreateUser([
'access content',
'administer content types',
'administer node fields',
'administer node display',
'bypass node access',
'administer nodes',
]);
$this->drupalLogin($admin_user);
$this->fieldName = mb_strtolower($this->randomMachineName(8));
......
......@@ -92,7 +92,10 @@ protected function setUp(): void {
])
->save();
$account = $this->drupalCreateUser(['access content', "create $this->referencingType content"]);
$account = $this->drupalCreateUser([
'access content',
"create $this->referencingType content",
]);
$this->drupalLogin($account);
}
......
......@@ -44,7 +44,13 @@ protected function setUp(): void {
$this->drupalCreateContentType(['type' => 'referenced_content']);
// Create admin user.
$this->adminUser = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'bypass node access']);
$this->adminUser = $this->drupalCreateUser([
'access content',
'administer content types',
'administer node fields',
'administer node form display',
'bypass node access',
]);
$this->drupalLogin($this->adminUser);
}
......
......@@ -147,7 +147,9 @@ protected function setUp(): void {
$this->setUpEntityReferenceField();
$this->createContent();
$this->webUser = $this->drupalCreateUser(['edit any ' . $this->referrerType->id() . ' content']);
$this->webUser = $this->drupalCreateUser([
'edit any ' . $this->referrerType->id() . ' content',
]);
}
/**
......
......@@ -121,7 +121,10 @@ protected function setUp(): void {
* Tests that the autocomplete input element does not cause ajax fatal.
*/
public function testFileUpload() {
$user1 = $this->drupalCreateUser(['access content', "create $this->referencingType content"]);
$user1 = $this->drupalCreateUser([
'access content',
"create $this->referencingType content",
]);
$this->drupalLogin($user1);
$test_file = current($this->getTestFiles('text'));
......
......@@ -59,7 +59,11 @@ protected function setUp(): void {
parent::setUp();
// Create a test user.
$web_user = $this->drupalCreateUser(['administer entity_test content', 'administer entity_test fields', 'view test entity']);
$web_user = $this->drupalCreateUser([
'administer entity_test content',
'administer entity_test fields',
'view test entity',
]);
$this->drupalLogin($web_user);
}
......
......@@ -35,7 +35,10 @@ protected function setUp(): void {
parent::setUp();
// Create the admin user.
$this->adminUser = $this->drupalCreateUser(['access administration pages', 'view the administration theme']);
$this->adminUser = $this->drupalCreateUser([
'access administration pages',
'view the administration theme',
]);
}
/**
......
......@@ -69,7 +69,10 @@ class FormTest extends FieldTestBase {
protected function setUp(): void {
parent::setUp();
$web_user = $this->drupalCreateUser(['view test entity', 'administer entity_test content']);
$web_user = $this->drupalCreateUser([
'view test entity',
'administer entity_test content',
]);
$this->drupalLogin($web_user);
$this->fieldStorageSingle = [
......
......@@ -28,7 +28,10 @@ class NestedFormTest extends FieldTestBase {
protected function setUp(): void {
parent::setUp();
$web_user = $this->drupalCreateUser(['view test entity', 'administer entity_test content']);
$web_user = $this->drupalCreateUser([
'view test entity',
'administer entity_test content',
]);
$this->drupalLogin($web_user);
$this->fieldStorageSingle = [
......
......@@ -96,7 +96,10 @@ public function testReEnabledField() {
// Test that the module can't be uninstalled from the UI while there is data
// for its fields.
$admin_user = $this->drupalCreateUser(['access administration pages', 'administer modules']);
$admin_user = $this->drupalCreateUser([
'access administration pages',
'administer modules',
]);
$this->drupalLogin($admin_user);
$this->drupalGet('admin/modules/uninstall');
$this->assertText("The Telephone number field type is used in the following field: node.field_telephone");
......
......@@ -37,7 +37,11 @@ class StringFieldTest extends BrowserTestBase {
protected function setUp(): void {
parent::setUp();
$this->webUser = $this->drupalCreateUser(['view test entity', 'administer entity_test content', 'access content']);
$this->webUser = $this->drupalCreateUser([
'view test entity',
'administer entity_test content',
'access content',
]);
$this->drupalLogin($this->webUser);
}
......
......@@ -92,7 +92,10 @@ protected function setUp(): void {
* Tests field translations when creating a new revision.
*/
public function testFieldFormTranslationRevisions() {
$web_user = $this->drupalCreateUser(['view test entity', 'administer entity_test content']);
$web_user = $this->drupalCreateUser([
'view test entity',
'administer entity_test content',
]);
$this->drupalLogin($web_user);
// Prepare the field translations.
......
......@@ -54,7 +54,17 @@ protected function setUp(): void {
$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 @@ protected function setUp(): void {
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.
......
......@@ -49,7 +49,20 @@ protected function setUp(): void {
$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.
......
......@@ -81,7 +81,20 @@ protected function setUp(): void {
$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.
......
......@@ -51,7 +51,17 @@ protected function setUp(): void {
$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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment