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
......@@ -86,7 +86,10 @@ protected function setUp($import_test_views = TRUE): void {
* Tests exposed context.
*/
public function testBlockContext() {
$this->drupalLogin($this->drupalCreateUser(['administer views', 'administer blocks']));
$this->drupalLogin($this->drupalCreateUser([
'administer views',
'administer blocks',
]));
// Check if context was correctly propagated to the block.
$definition = $this->container->get('plugin.manager.block')
......
......@@ -38,7 +38,9 @@ protected function setUp($import_test_views = TRUE): void {
$this->drupalPlaceBlock('page_title_block');
$admin_user = $this->drupalCreateUser(['administer site configuration']);
$admin_user = $this->drupalCreateUser([
'administer site configuration',
]);
$this->drupalLogin($admin_user);
}
......
......@@ -53,7 +53,10 @@ protected function setUp($import_test_views = TRUE): void {
$this->enableViewsTestModule();
$this->adminUser = $this->drupalCreateUser(['administer views', 'administer menu']);
$this->adminUser = $this->drupalCreateUser([
'administer views',
'administer menu',
]);
$this->drupalPlaceBlock('system_menu_block:main');
$this->drupalCreateContentType(['type' => 'page']);
}
......
......@@ -36,7 +36,10 @@ class NumericFormatPluralTest extends ViewTestBase {
protected function setUp($import_test_views = TRUE): void {
parent::setUp($import_test_views);
$web_user = $this->drupalCreateUser(['administer views', 'administer languages']);
$web_user = $this->drupalCreateUser([
'administer views',
'administer languages',
]);
$this->drupalLogin($web_user);
}
......
......@@ -51,7 +51,10 @@ public function testStorePagerSettings() {
// Show the master display so the override selection is shown.
\Drupal::configFactory()->getEditable('views.settings')->set('ui.show.master_display', TRUE)->save();
$admin_user = $this->drupalCreateUser(['administer views', 'administer site configuration']);
$admin_user = $this->drupalCreateUser([
'administer views',
'administer site configuration',
]);
$this->drupalLogin($admin_user);
// Test behavior described in
// https://www.drupal.org/node/652712#comment-2354918.
......@@ -384,7 +387,12 @@ public function testPagerConfigTranslation() {
$this->container->get('module_installer')->install(['locale', 'language', 'config_translation']);
$this->resetAll();
$admin_user = $this->drupalCreateUser(['access content overview', 'administer nodes', 'bypass node access', 'translate configuration']);
$admin_user = $this->drupalCreateUser([
'access content overview',
'administer nodes',
'bypass node access',
'translate configuration',
]);
$this->drupalLogin($admin_user);
$langcode = 'nl';
......
......@@ -45,7 +45,14 @@ class SearchMultilingualTest extends ViewTestBase {
public function testMultilingualSearchFilter() {
// Create a user with admin for languages, content, and content types, plus
// the ability to access content and searches.
$user = $this->drupalCreateUser(['administer nodes', 'administer content types', 'administer languages', 'administer content translation', 'access content', 'search content']);
$user = $this->drupalCreateUser([
'administer nodes',
'administer content types',
'administer languages',
'administer content translation',
'access content',
'search content',
]);
$this->drupalLogin($user);
// Add Spanish language programmatically.
......
......@@ -20,7 +20,13 @@ protected function setUp($import_test_views = TRUE) {
parent::setUp($import_test_views);
// Create and log in a user with administer views permission.
$views_admin = $this->drupalCreateUser(['administer views', 'administer blocks', 'bypass node access', 'access user profiles', 'view all revisions']);
$views_admin = $this->drupalCreateUser([
'administer views',
'administer blocks',
'bypass node access',
'access user profiles',
'view all revisions',
]);
$this->drupalLogin($views_admin);
$this->drupalPlaceBlock('local_actions_block');
}
......
......@@ -41,7 +41,10 @@ protected function setUp($import_test_views = TRUE): void {
* Tests that an option for a filter is saved as expected from the UI.
*/
public function testFilterInOperatorUi() {
$admin_user = $this->drupalCreateUser(['administer views', 'administer site configuration']);
$admin_user = $this->drupalCreateUser([
'administer views',
'administer site configuration',
]);
$this->drupalLogin($admin_user);
$path = 'admin/structure/views/nojs/handler/test_filter_in_operator_ui/default/filter/type';
......@@ -64,7 +67,10 @@ public function testFilterInOperatorUi() {
* Tests the filters from the UI.
*/
public function testFiltersUI() {
$admin_user = $this->drupalCreateUser(['administer views', 'administer site configuration']);
$admin_user = $this->drupalCreateUser([
'administer views',
'administer site configuration',
]);
$this->drupalLogin($admin_user);
$this->drupalGet('admin/structure/views/view/test_filter_groups');
......@@ -96,7 +102,10 @@ public function testFiltersUI() {
* Tests the identifier settings and restrictions.
*/
public function testFilterIdentifier() {
$admin_user = $this->drupalCreateUser(['administer views', 'administer site configuration']);
$admin_user = $this->drupalCreateUser([
'administer views',
'administer site configuration',
]);
$this->drupalLogin($admin_user);
$path = 'admin/structure/views/nojs/handler/test_filter_in_operator_ui/default/filter/type';
......
......@@ -40,7 +40,10 @@ class ViewsUITourTest extends TourTestBase {
protected function setUp(): void {
parent::setUp();
$this->adminUser = $this->drupalCreateUser(['administer views', 'access tour']);
$this->adminUser = $this->drupalCreateUser([
'administer views',
'access tour',
]);
$this->drupalLogin($this->adminUser);
}
......
......@@ -33,7 +33,10 @@ public function testMinimal() {
// Create a user to test tools and navigation blocks for logged in users
// with appropriate permissions.
$user = $this->drupalCreateUser(['access administration pages', 'administer content types']);
$user = $this->drupalCreateUser([
'access administration pages',
'administer content types',
]);
$this->drupalLogin($user);
$this->drupalGet('');
$this->assertText(t('Tools'));
......
......@@ -46,7 +46,9 @@ protected function setUp(): void {
'id' => 'default',
'label' => 'Default',
])->save();
$this->account = $this->drupalCreateUser(['administer entity_test content']);
$this->account = $this->drupalCreateUser([
'administer entity_test content',
]);
$this->drupalLogin($this->account);
}
......
......@@ -43,7 +43,11 @@ public function testMixedCasePaths() {
$this->assertSession()->pageTextMatches('/Log in/');
// Tests paths defined by routes from the Views module.
$admin = $this->drupalCreateUser(['access administration pages', 'administer nodes', 'access content overview']);
$admin = $this->drupalCreateUser([
'access administration pages',
'administer nodes',
'access content overview',
]);
$this->drupalLogin($admin);
$this->drupalGet('admin/content');
......
......@@ -39,7 +39,11 @@ protected function setUp(): void {
parent::setUp();
// Create and log in user.
$this->adminUser = $this->drupalCreateUser(['administer blocks', 'administer languages', 'access administration pages']);
$this->adminUser = $this->drupalCreateUser([
'administer blocks',
'administer languages',
'access administration pages',
]);
$this->drupalLogin($this->adminUser);
// Add language.
......
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