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
......@@ -37,7 +37,18 @@ abstract class FileFieldTestBase extends BrowserTestBase {
*/
protected function setUp() {
parent::setUp();
$this->adminUser = $this->drupalCreateUser(['access content', 'access administration pages', 'administer site configuration', 'administer users', 'administer permissions', 'administer content types', 'administer node fields', 'administer node display', 'administer nodes', 'bypass node access']);
$this->adminUser = $this->drupalCreateUser([
'access content',
'access administration pages',
'administer site configuration',
'administer users',
'administer permissions',
'administer content types',
'administer node fields',
'administer node display',
'administer nodes',
'bypass node access',
]);
$this->drupalLogin($this->adminUser);
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
}
......
......@@ -40,7 +40,10 @@ protected function setUp(): void {
->set('make_unused_managed_files_temporary', TRUE)
->save();
$this->adminUser = $this->drupalCreateUser(['access files overview', 'bypass node access']);
$this->adminUser = $this->drupalCreateUser([
'access files overview',
'bypass node access',
]);
$this->baseUser = $this->drupalCreateUser();
$this->createFileField('file', 'node', 'article', [], ['file_extensions' => 'txt png']);
}
......
......@@ -42,7 +42,18 @@ class FileFieldWidgetTest extends WebDriverTestBase {
*/
protected function setUp(): void {
parent::setUp();
$this->adminUser = $this->drupalCreateUser(['access content', 'access administration pages', 'administer site configuration', 'administer users', 'administer permissions', 'administer content types', 'administer node fields', 'administer node display', 'administer nodes', 'bypass node access']);
$this->adminUser = $this->drupalCreateUser([
'access content',
'access administration pages',
'administer site configuration',
'administer users',
'administer permissions',
'administer content types',
'administer node fields',
'administer node display',
'administer nodes',
'bypass node access',
]);
$this->drupalLogin($this->adminUser);
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
}
......
......@@ -33,7 +33,18 @@ class FileManagedFileElementTest extends WebDriverTestBase {
*/
protected function setUp(): void {
parent::setUp();
$this->adminUser = $this->drupalCreateUser(['access content', 'access administration pages', 'administer site configuration', 'administer users', 'administer permissions', 'administer content types', 'administer node fields', 'administer node display', 'administer nodes', 'bypass node access']);
$this->adminUser = $this->drupalCreateUser([
'access content',
'access administration pages',
'administer site configuration',
'administer users',
'administer permissions',
'administer content types',
'administer node fields',
'administer node display',
'administer nodes',
'bypass node access',
]);
$this->drupalLogin($this->adminUser);
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
}
......
......@@ -111,7 +111,10 @@ protected function setUp(): void {
'access site reports',
]);
$this->webUser = $this->drupalCreateUser(['create page content', 'edit own page content']);
$this->webUser = $this->drupalCreateUser([
'create page content',
'edit own page content',
]);
user_role_grant_permissions('authenticated', [$basic_html_format->getPermissionName()]);
user_role_grant_permissions('anonymous', [$restricted_html_format->getPermissionName()]);
$this->drupalLogin($this->adminUser);
......
......@@ -44,7 +44,10 @@ public function testDefaultTextFormats() {
}
list($first_format, $second_format) = $formats;
$second_format_permission = $second_format->getPermissionName();
$first_user = $this->drupalCreateUser([$first_format->getPermissionName(), $second_format_permission]);
$first_user = $this->drupalCreateUser([
$first_format->getPermissionName(),
$second_format_permission,
]);
$second_user = $this->drupalCreateUser([$second_format_permission]);
// Adjust the weights so that the first and second formats (in that order)
......
......@@ -36,7 +36,11 @@ public function testFilterHooks() {
$type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
$node_permission = "create $type_name content";
$admin_user = $this->drupalCreateUser(['administer filters', 'administer nodes', $node_permission]);
$admin_user = $this->drupalCreateUser([
'administer filters',
'administer nodes',
$node_permission,
]);
$this->drupalLogin($admin_user);
// Add a text format.
......
......@@ -46,7 +46,11 @@ protected function setUp(): void {
$filtered_html_permission = $filtered_html_format->getPermissionName();
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, [$filtered_html_permission]);
$this->adminUser = $this->drupalCreateUser(['administer modules', 'administer filters', 'administer site configuration']);
$this->adminUser = $this->drupalCreateUser([
'administer modules',
'administer filters',
'administer site configuration',
]);
$this->drupalLogin($this->adminUser);
}
......
......@@ -27,7 +27,13 @@ protected function setUp(): void {
parent::setUp();
// Create a test user.
$web_user = $this->drupalCreateUser(['create forum content', 'edit own forum content', 'edit any forum content', 'administer nodes', 'administer forums']);
$web_user = $this->drupalCreateUser([
'create forum content',
'edit own forum content',
'edit any forum content',
'administer nodes',
'administer forums',
]);
$this->drupalLogin($web_user);
}
......
......@@ -49,7 +49,12 @@ public function testForumNodeAccess() {
// Create some users.
$access_user = $this->drupalCreateUser(['node test view']);
$no_access_user = $this->drupalCreateUser();
$admin_user = $this->drupalCreateUser(['access administration pages', 'administer modules', 'administer blocks', 'create forum content']);
$admin_user = $this->drupalCreateUser([
'access administration pages',
'administer modules',
'administer blocks',
'create forum content',
]);
$this->drupalLogin($admin_user);
......
......@@ -224,7 +224,11 @@ public function testForum() {
$this->assertEquals('6', $elements[0]->getText(), 'Number of posts found.');
// Test loading multiple forum nodes on the front page.
$this->drupalLogin($this->drupalCreateUser(['administer content types', 'create forum content', 'post comments']));
$this->drupalLogin($this->drupalCreateUser([
'administer content types',
'create forum content',
'post comments',
]));
$this->drupalPostForm('admin/structure/types/manage/forum', ['options[promote]' => 'promote'], t('Save content type'));
$this->createForumTopic($this->forum, FALSE);
$this->createForumTopic($this->forum, FALSE);
......
......@@ -32,7 +32,13 @@ class ForumUninstallTest extends BrowserTestBase {
* Tests if forum module uninstallation properly deletes the field.
*/
public function testForumUninstallWithField() {
$this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'administer nodes', 'administer modules', 'delete any forum content', 'administer content types']));
$this->drupalLogin($this->drupalCreateUser([
'administer taxonomy',
'administer nodes',
'administer modules',
'delete any forum content',
'administer content types',
]));
// Ensure that the field exists before uninstallation.
$field_storage = FieldStorageConfig::loadByName('node', 'taxonomy_forums');
$this->assertNotNull($field_storage, 'The taxonomy_forums field storage exists.');
......
......@@ -49,7 +49,11 @@ protected function setUp(): void {
parent::setUp();
// Create users.
$this->adminUser = $this->drupalCreateUser(['access administration pages', 'view the administration theme', 'administer permissions']);
$this->adminUser = $this->drupalCreateUser([
'access administration pages',
'view the administration theme',
'administer permissions',
]);
$this->anyUser = $this->drupalCreateUser([]);
}
......
......@@ -47,7 +47,10 @@ protected function setUp(): void {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
$this->user = $this->drupalCreateUser(['create page content', 'access content']);
$this->user = $this->drupalCreateUser([
'create page content',
'access content',
]);
$this->drupalLogin($this->user);
$this->testNode = $this->drupalCreateNode(['type' => 'page', 'uid' => $this->user->id()]);
}
......
......@@ -54,7 +54,19 @@ protected function setUp() {
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
}
$this->adminUser = $this->drupalCreateUser(['access content', 'access administration pages', 'administer site configuration', 'administer content types', 'administer node fields', 'administer nodes', 'create article content', 'edit any article content', 'delete any article content', 'administer image styles', 'administer node display']);
$this->adminUser = $this->drupalCreateUser([
'access content',
'access administration pages',
'administer site configuration',
'administer content types',
'administer node fields',
'administer nodes',
'create article content',
'edit any article content',
'delete any article content',
'administer image styles',
'administer node display',
]);
$this->drupalLogin($this->adminUser);
}
......
......@@ -1029,7 +1029,10 @@ public function testNonTranslatableEntityUpdatesFromIssue3043168() {
$this->assertInstanceOf(TranslatableInterface::class, $entity);
$this->assertFalse($entity->isTranslatable());
// Set up a test user with permission to view and update the test entity.
$user = $this->drupalCreateUser(['view test entity', 'administer entity_test content']);
$user = $this->drupalCreateUser([
'view test entity',
'administer entity_test content',
]);
$request_options[RequestOptions::HEADERS]['Accept'] = 'application/vnd.api+json';
$request_options[RequestOptions::AUTH] = [
$user->getAccountName(),
......
......@@ -19,7 +19,11 @@ class LanguageBlockSettingsVisibilityTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
public function testUnnecessaryLanguageSettingsVisibility() {
$admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'administer blocks']);
$admin_user = $this->drupalCreateUser([
'administer languages',
'access administration pages',
'administer blocks',
]);
$this->drupalLogin($admin_user);
$this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'hu'], t('Add language'));
$this->drupalGet('admin/structure/block/add/system_menu_block:admin/stark');
......
......@@ -25,7 +25,10 @@ class LanguageBrowserDetectionTest extends BrowserTestBase {
*/
public function testUIBrowserLanguageMappings() {
// User to manage languages.
$admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
$admin_user = $this->drupalCreateUser([
'administer languages',
'access administration pages',
]);
$this->drupalLogin($admin_user);
// Check that the configure link exists.
......
......@@ -35,7 +35,11 @@ class LanguageConfigurationElementTest extends BrowserTestBase {
protected function setUp(): void {
parent::setUp();
$user = $this->drupalCreateUser(['access administration pages', 'administer languages', 'administer content types']);
$user = $this->drupalCreateUser([
'access administration pages',
'administer languages',
'administer content types',
]);
$this->drupalLogin($user);
}
......
......@@ -36,7 +36,10 @@ public function testLanguageConfiguration() {
$this->assertEqual(ConfigurableLanguage::load('en')->getWeight(), 0, 'The English language has a weight of 0.');
// User to add and remove language.
$admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
$admin_user = $this->drupalCreateUser([
'administer languages',
'access administration pages',
]);
$this->drupalLogin($admin_user);
// Check if the Default English language has no path prefix.
......@@ -157,7 +160,10 @@ public function testLanguageConfiguration() {
*/
public function testLanguageConfigurationWeight() {
// User to add and remove language.
$admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
$admin_user = $this->drupalCreateUser([
'administer languages',
'access administration pages',
]);
$this->drupalLogin($admin_user);
$this->checkConfigurableLanguageWeight();
......
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