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
......@@ -32,7 +32,10 @@ class LanguageCustomLanguageConfigurationTest extends BrowserTestBase {
public function testLanguageConfiguration() {
// Create user with permissions to add and remove languages.
$admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
$admin_user = $this->drupalCreateUser([
'administer languages',
'access administration pages',
]);
$this->drupalLogin($admin_user);
// Add custom language.
......
......@@ -30,7 +30,10 @@ class LanguageListModuleInstallTest extends BrowserTestBase {
public function testModuleInstallLanguageList() {
// Since LanguageManager::getLanguages() uses static caches we need to do
// this by enabling the module using the UI.
$admin_user = $this->drupalCreateUser(['access administration pages', 'administer modules']);
$admin_user = $this->drupalCreateUser([
'access administration pages',
'administer modules',
]);
$this->drupalLogin($admin_user);
$edit = [];
$edit['modules[language][enable]'] = 'language';
......
......@@ -33,7 +33,10 @@ class LanguageListTest extends BrowserTestBase {
public function testLanguageList() {
// 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);
// Get the weight of the last language.
......
......@@ -38,7 +38,10 @@ protected function setUp(): void {
*/
public function testLanguageLocaleList() {
// 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);
// Add predefined language.
......
......@@ -31,7 +31,12 @@ class LanguageNegotiationInfoTest extends BrowserTestBase {
*/
protected function setUp(): void {
parent::setUp();
$admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'view the administration theme', 'administer modules']);
$admin_user = $this->drupalCreateUser([
'administer languages',
'access administration pages',
'view the administration theme',
'administer modules',
]);
$this->drupalLogin($admin_user);
$this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'it'], t('Add language'));
}
......
......@@ -27,7 +27,11 @@ protected function setUp(): void {
parent::setUp();
// Create and log in user.
$web_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'administer site configuration']);
$web_user = $this->drupalCreateUser([
'administer languages',
'access administration pages',
'administer site configuration',
]);
$this->drupalLogin($web_user);
// Enable French language.
......
......@@ -38,7 +38,11 @@ protected function setUp(): void {
parent::setUp();
// Create and log in user.
$admin_user = $this->drupalCreateUser(['administer blocks', 'administer languages', 'access administration pages']);
$admin_user = $this->drupalCreateUser([
'administer blocks',
'administer languages',
'access administration pages',
]);
$this->drupalLogin($admin_user);
}
......
......@@ -35,7 +35,10 @@ class LanguageTourTest extends TourTestBase {
*/
protected function setUp(): void {
parent::setUp();
$this->adminUser = $this->drupalCreateUser(['administer languages', 'access tour']);
$this->adminUser = $this->drupalCreateUser([
'administer languages',
'access tour',
]);
$this->drupalLogin($this->adminUser);
$this->drupalPlaceBlock('local_actions_block');
}
......
......@@ -74,7 +74,12 @@ class LanguageUILanguageNegotiationTest extends BrowserTestBase {
protected function setUp(): void {
parent::setUp();
$this->adminUser = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages', 'administer blocks']);
$this->adminUser = $this->drupalCreateUser([
'administer languages',
'translate interface',
'access administration pages',
'administer blocks',
]);
$this->drupalLogin($this->adminUser);
}
......
......@@ -39,7 +39,10 @@ protected function setUp(): void {
parent::setUp();
// Create and log in user.
$this->webUser = $this->drupalCreateUser(['administer languages', 'access administration pages']);
$this->webUser = $this->drupalCreateUser([
'administer languages',
'access administration pages',
]);
$this->drupalLogin($this->webUser);
// Install French language.
......
......@@ -189,7 +189,12 @@ public function testAccessWithoutBundles(array $permissions, $default_access, $n
$this->drupalGet('user/' . $non_editable_user->id() . '/layout');
$this->assertExpectedAccess($non_editable_access);
$non_viewable_user = $this->drupalCreateUser([], 'bad person', FALSE, ['status' => 0]);
$non_viewable_user = $this->drupalCreateUser(
[],
'bad person',
FALSE,
['status' => 0]
);
$this->drupalGet($non_viewable_user->toUrl());
$this->assertExpectedAccess(FALSE);
$this->drupalGet($non_viewable_user->toUrl('edit-form'));
......
......@@ -68,8 +68,14 @@ protected function setUp(): void {
$this->firstContentType = $this->drupalCreateContentType();
$this->secondContentType = $this->drupalCreateContentType();
$this->adminUser = $this->drupalCreateUser(['administer content types', 'administer node fields', 'administer node display']);
$this->helpTextUser = $this->drupalCreateUser(['create ' . $this->secondContentType->id() . ' content']);
$this->adminUser = $this->drupalCreateUser([
'administer content types',
'administer node fields',
'administer node display',
]);
$this->helpTextUser = $this->drupalCreateUser([
'create ' . $this->secondContentType->id() . ' content',
]);
$this->drupalPlaceBlock('system_breadcrumb_block');
}
......
......@@ -36,7 +36,13 @@ protected function setUp(): void {
* Test update changes configuration translations if enabled after language.
*/
public function testConfigTranslationImport() {
$admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'administer permissions']);
$admin_user = $this->drupalCreateUser([
'administer modules',
'administer site configuration',
'administer languages',
'access administration pages',
'administer permissions',
]);
$this->drupalLogin($admin_user);
// Add a language. The Afrikaans translation file of locale_test_translate
......@@ -90,7 +96,14 @@ public function testConfigTranslationModuleInstall() {
// import. Test that this override is in place.
$this->assertFalse($this->config('locale.settings')->get('translation.import_enabled'), 'Translations imports are disabled by default in the Testing profile.');
$admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'administer permissions', 'translate configuration']);
$admin_user = $this->drupalCreateUser([
'administer modules',
'administer site configuration',
'administer languages',
'access administration pages',
'administer permissions',
'translate configuration',
]);
$this->drupalLogin($admin_user);
// Enable import of translations. By default this is disabled for automated
......@@ -149,7 +162,14 @@ public function testLocaleRemovalAndConfigOverrideDelete() {
$this->container->get('module_installer')->install(['locale']);
$this->resetAll();
$admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'administer permissions', 'translate interface']);
$admin_user = $this->drupalCreateUser([
'administer modules',
'administer site configuration',
'administer languages',
'access administration pages',
'administer permissions',
'translate interface',
]);
$this->drupalLogin($admin_user);
// Enable import of translations. By default this is disabled for automated
......@@ -187,7 +207,14 @@ public function testLocaleRemovalAndConfigOverridePreserve() {
$this->container->get('module_installer')->install(['locale']);
$this->resetAll();
$admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'administer permissions', 'translate interface']);
$admin_user = $this->drupalCreateUser([
'administer modules',
'administer site configuration',
'administer languages',
'access administration pages',
'administer permissions',
'translate interface',
]);
$this->drupalLogin($admin_user);
// Enable import of translations. By default this is disabled for automated
......
......@@ -48,7 +48,15 @@ protected function setUp(): void {
// Add custom language.
$this->langcode = 'xx';
$admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'translate interface', 'administer modules', 'access site-wide contact form', 'administer contact forms', 'administer site configuration']);
$admin_user = $this->drupalCreateUser([
'administer languages',
'access administration pages',
'translate interface',
'administer modules',
'access site-wide contact form',
'administer contact forms',
'administer site configuration',
]);
$this->drupalLogin($admin_user);
$name = $this->randomMachineName(16);
$edit = [
......
......@@ -31,7 +31,12 @@ class LocaleContentTest extends BrowserTestBase {
*/
public function testMachineNameLTR() {
// User to add and remove language.
$admin_user = $this->drupalCreateUser(['administer languages', 'administer content types', 'access administration pages', 'administer site configuration']);
$admin_user = $this->drupalCreateUser([
'administer languages',
'administer content types',
'access administration pages',
'administer site configuration',
]);
// Log in as admin.
$this->drupalLogin($admin_user);
......@@ -63,9 +68,17 @@ public function testContentTypeLanguageConfiguration() {
$type2 = $this->drupalCreateContentType();
// User to add and remove language.
$admin_user = $this->drupalCreateUser(['administer languages', 'administer content types', 'access administration pages']);
$admin_user = $this->drupalCreateUser([
'administer languages',
'administer content types',
'access administration pages',
]);
// User to create a node.
$web_user = $this->drupalCreateUser(["create {$type1->id()} content", "create {$type2->id()} content", "edit any {$type2->id()} content"]);
$web_user = $this->drupalCreateUser([
"create {$type1->id()} content",
"create {$type2->id()} content",
"edit any {$type2->id()} content",
]);
// Add custom language.
$this->drupalLogin($admin_user);
......@@ -140,9 +153,16 @@ public function testContentTypeDirLang() {
$type = $this->drupalCreateContentType();
// User to add and remove language.
$admin_user = $this->drupalCreateUser(['administer languages', 'administer content types', 'access administration pages']);
$admin_user = $this->drupalCreateUser([
'administer languages',
'administer content types',
'access administration pages',
]);
// User to create a node.
$web_user = $this->drupalCreateUser(["create {$type->id()} content", "edit own {$type->id()} content"]);
$web_user = $this->drupalCreateUser([
"create {$type->id()} content",
"edit own {$type->id()} content",
]);
// Log in as admin.
$this->drupalLogin($admin_user);
......
......@@ -35,7 +35,11 @@ class LocaleExportTest extends BrowserTestBase {
protected function setUp(): void {
parent::setUp();
$this->adminUser = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages']);
$this->adminUser = $this->drupalCreateUser([
'administer languages',
'translate interface',
'access administration pages',
]);
$this->drupalLogin($this->adminUser);
// Copy test po files to the translations directory.
......
......@@ -55,8 +55,17 @@ protected function setUp(): void {
$file_system->copy(__DIR__ . '/../../../tests/test.de.po', 'translations://', FileSystemInterface::EXISTS_REPLACE);
$file_system->copy(__DIR__ . '/../../../tests/test.xx.po', 'translations://', FileSystemInterface::EXISTS_REPLACE);
$this->adminUser = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages']);
$this->adminUserAccessSiteReports = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages', 'access site reports']);
$this->adminUser = $this->drupalCreateUser([
'administer languages',
'translate interface',
'access administration pages',
]);
$this->adminUserAccessSiteReports = $this->drupalCreateUser([
'administer languages',
'translate interface',
'access administration pages',
'access site reports',
]);
$this->drupalLogin($this->adminUser);
// Enable import of translations. By default this is disabled for automated
......
......@@ -116,7 +116,11 @@ public function testFileParsing() {
*/
public function testLocaleTranslationJsDependencies() {
// User to add and remove language.
$admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'translate interface']);
$admin_user = $this->drupalCreateUser([
'administer languages',
'access administration pages',
'translate interface',
]);
// Add custom language.
$this->drupalLogin($admin_user);
......
......@@ -44,7 +44,14 @@ protected function setUp(): void {
*/
public function testPathLanguageConfiguration() {
// User to add and remove language.
$admin_user = $this->drupalCreateUser(['administer languages', 'create page content', 'administer url aliases', 'create url aliases', 'access administration pages', 'access content overview']);
$admin_user = $this->drupalCreateUser([
'administer languages',
'create page content',
'administer url aliases',
'create url aliases',
'access administration pages',
'access content overview',
]);
// Add custom language.
$this->drupalLogin($admin_user);
......
......@@ -39,7 +39,11 @@ class LocalePluralFormatTest extends BrowserTestBase {
protected function setUp(): void {
parent::setUp();
$this->adminUser = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages']);
$this->adminUser = $this->drupalCreateUser([
'administer languages',
'translate interface',
'access administration pages',
]);
$this->drupalLogin($this->adminUser);
}
......
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