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 de32f3ca2d
)
merge-requests/64/head
parent
6293597536
commit
f1f335a795
|
@ -46,7 +46,12 @@ abstract class AggregatorTestBase extends BrowserTestBase {
|
||||||
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
|
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->adminUser = $this->drupalCreateUser(['access administration pages', 'administer news feeds', 'access news feeds', 'create article content']);
|
$this->adminUser = $this->drupalCreateUser([
|
||||||
|
'access administration pages',
|
||||||
|
'administer news feeds',
|
||||||
|
'access news feeds',
|
||||||
|
'create article content',
|
||||||
|
]);
|
||||||
$this->drupalLogin($this->adminUser);
|
$this->drupalLogin($this->adminUser);
|
||||||
$this->drupalPlaceBlock('local_tasks_block');
|
$this->drupalPlaceBlock('local_tasks_block');
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,13 @@ class FeedLanguageTest extends AggregatorTestBase {
|
||||||
* Tests creation of feeds with a language.
|
* Tests creation of feeds with a language.
|
||||||
*/
|
*/
|
||||||
public function testFeedLanguage() {
|
public function testFeedLanguage() {
|
||||||
$admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'administer news feeds', 'access news feeds', 'create article content']);
|
$admin_user = $this->drupalCreateUser([
|
||||||
|
'administer languages',
|
||||||
|
'access administration pages',
|
||||||
|
'administer news feeds',
|
||||||
|
'access news feeds',
|
||||||
|
'create article content',
|
||||||
|
]);
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Enable language selection for feeds.
|
// Enable language selection for feeds.
|
||||||
|
|
|
@ -29,7 +29,12 @@ class ImportOpmlTest extends AggregatorTestBase {
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$admin_user = $this->drupalCreateUser(['administer news feeds', 'access news feeds', 'create article content', 'administer blocks']);
|
$admin_user = $this->drupalCreateUser([
|
||||||
|
'administer news feeds',
|
||||||
|
'access news feeds',
|
||||||
|
'create article content',
|
||||||
|
'administer blocks',
|
||||||
|
]);
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,10 @@ class BlockAdminThemeTest extends BrowserTestBase {
|
||||||
*/
|
*/
|
||||||
public function testAdminTheme() {
|
public function testAdminTheme() {
|
||||||
// Create administrative user.
|
// Create administrative user.
|
||||||
$admin_user = $this->drupalCreateUser(['administer blocks', 'administer themes']);
|
$admin_user = $this->drupalCreateUser([
|
||||||
|
'administer blocks',
|
||||||
|
'administer themes',
|
||||||
|
]);
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Ensure that access to block admin page is denied when theme is not
|
// Ensure that access to block admin page is denied when theme is not
|
||||||
|
|
|
@ -56,7 +56,10 @@ class BlockCacheTest extends BrowserTestBase {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
// Create an admin user, log in and enable test blocks.
|
// Create an admin user, log in and enable test blocks.
|
||||||
$this->adminUser = $this->drupalCreateUser(['administer blocks', 'access administration pages']);
|
$this->adminUser = $this->drupalCreateUser([
|
||||||
|
'administer blocks',
|
||||||
|
'access administration pages',
|
||||||
|
]);
|
||||||
$this->drupalLogin($this->adminUser);
|
$this->drupalLogin($this->adminUser);
|
||||||
|
|
||||||
// Create additional users to test caching modes.
|
// Create additional users to test caching modes.
|
||||||
|
|
|
@ -28,7 +28,10 @@ class BlockDemoTest extends BrowserTestBase {
|
||||||
*/
|
*/
|
||||||
public function testBlockDemo() {
|
public function testBlockDemo() {
|
||||||
// Create administrative user.
|
// Create administrative user.
|
||||||
$admin_user = $this->drupalCreateUser(['administer blocks', 'administer themes']);
|
$admin_user = $this->drupalCreateUser([
|
||||||
|
'administer blocks',
|
||||||
|
'administer themes',
|
||||||
|
]);
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Confirm we have access to the block demo page for the default theme.
|
// Confirm we have access to the block demo page for the default theme.
|
||||||
|
|
|
@ -33,7 +33,10 @@ class BlockLanguageTest extends BrowserTestBase {
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$this->adminUser = $this->drupalCreateUser(['administer blocks', 'administer languages']);
|
$this->adminUser = $this->drupalCreateUser([
|
||||||
|
'administer blocks',
|
||||||
|
'administer languages',
|
||||||
|
]);
|
||||||
$this->drupalLogin($this->adminUser);
|
$this->drupalLogin($this->adminUser);
|
||||||
|
|
||||||
// Add predefined language.
|
// Add predefined language.
|
||||||
|
|
|
@ -32,7 +32,10 @@ class BlockXssTest extends BrowserTestBase {
|
||||||
* Tests that nothing is escaped other than the blocks explicitly tested.
|
* Tests that nothing is escaped other than the blocks explicitly tested.
|
||||||
*/
|
*/
|
||||||
public function testNoUnexpectedEscaping() {
|
public function testNoUnexpectedEscaping() {
|
||||||
$this->drupalLogin($this->drupalCreateUser(['administer blocks', 'access administration pages']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'administer blocks',
|
||||||
|
'access administration pages',
|
||||||
|
]));
|
||||||
$this->drupalGet(Url::fromRoute('block.admin_display'));
|
$this->drupalGet(Url::fromRoute('block.admin_display'));
|
||||||
$this->clickLink('Place block');
|
$this->clickLink('Place block');
|
||||||
$this->assertNoEscaped('<');
|
$this->assertNoEscaped('<');
|
||||||
|
@ -49,7 +52,10 @@ class BlockXssTest extends BrowserTestBase {
|
||||||
$this->drupalGet('');
|
$this->drupalGet('');
|
||||||
$this->assertNoRaw('<script>alert("XSS label");</script>', 'The block title was properly sanitized when rendered.');
|
$this->assertNoRaw('<script>alert("XSS label");</script>', 'The block title was properly sanitized when rendered.');
|
||||||
|
|
||||||
$this->drupalLogin($this->drupalCreateUser(['administer blocks', 'access administration pages']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'administer blocks',
|
||||||
|
'access administration pages',
|
||||||
|
]));
|
||||||
$default_theme = $this->config('system.theme')->get('default');
|
$default_theme = $this->config('system.theme')->get('default');
|
||||||
$this->drupalGet('admin/structure/block/list/' . $default_theme);
|
$this->drupalGet('admin/structure/block/list/' . $default_theme);
|
||||||
$this->assertNoRaw("<script>alert('XSS subject');</script>", 'The block title was properly sanitized in Block Plugin UI Admin page.');
|
$this->assertNoRaw("<script>alert('XSS subject');</script>", 'The block title was properly sanitized in Block Plugin UI Admin page.');
|
||||||
|
@ -61,7 +67,10 @@ class BlockXssTest extends BrowserTestBase {
|
||||||
public function testXssInCategory() {
|
public function testXssInCategory() {
|
||||||
$this->container->get('module_installer')->install(['block_test']);
|
$this->container->get('module_installer')->install(['block_test']);
|
||||||
$this->drupalPlaceBlock('test_xss_title');
|
$this->drupalPlaceBlock('test_xss_title');
|
||||||
$this->drupalLogin($this->drupalCreateUser(['administer blocks', 'access administration pages']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'administer blocks',
|
||||||
|
'access administration pages',
|
||||||
|
]));
|
||||||
$this->drupalGet(Url::fromRoute('block.admin_display'));
|
$this->drupalGet(Url::fromRoute('block.admin_display'));
|
||||||
$this->clickLink('Place block');
|
$this->clickLink('Place block');
|
||||||
$this->assertNoRaw("<script>alert('XSS category');</script>");
|
$this->assertNoRaw("<script>alert('XSS category');</script>");
|
||||||
|
|
|
@ -36,7 +36,10 @@ class NonDefaultBlockAdminTest extends BrowserTestBase {
|
||||||
* Test non-default theme admin.
|
* Test non-default theme admin.
|
||||||
*/
|
*/
|
||||||
public function testNonDefaultBlockAdmin() {
|
public function testNonDefaultBlockAdmin() {
|
||||||
$admin_user = $this->drupalCreateUser(['administer blocks', 'administer themes']);
|
$admin_user = $this->drupalCreateUser([
|
||||||
|
'administer blocks',
|
||||||
|
'administer themes',
|
||||||
|
]);
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
$new_theme = 'bartik';
|
$new_theme = 'bartik';
|
||||||
\Drupal::service('theme_installer')->install([$new_theme]);
|
\Drupal::service('theme_installer')->install([$new_theme]);
|
||||||
|
|
|
@ -65,7 +65,10 @@ class DisplayBlockTest extends ViewTestBase {
|
||||||
* Tests default and custom block categories.
|
* Tests default and custom block categories.
|
||||||
*/
|
*/
|
||||||
public function testBlockCategory() {
|
public function testBlockCategory() {
|
||||||
$this->drupalLogin($this->drupalCreateUser(['administer views', 'administer blocks']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'administer views',
|
||||||
|
'administer blocks',
|
||||||
|
]));
|
||||||
|
|
||||||
// Create a new view in the UI.
|
// Create a new view in the UI.
|
||||||
$edit = [];
|
$edit = [];
|
||||||
|
@ -368,7 +371,11 @@ class DisplayBlockTest extends ViewTestBase {
|
||||||
* Tests the contextual links on a Views block.
|
* Tests the contextual links on a Views block.
|
||||||
*/
|
*/
|
||||||
public function testBlockContextualLinks() {
|
public function testBlockContextualLinks() {
|
||||||
$this->drupalLogin($this->drupalCreateUser(['administer views', 'access contextual links', 'administer blocks']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'administer views',
|
||||||
|
'access contextual links',
|
||||||
|
'administer blocks',
|
||||||
|
]));
|
||||||
$block = $this->drupalPlaceBlock('views_block:test_view_block-block_1');
|
$block = $this->drupalPlaceBlock('views_block:test_view_block-block_1');
|
||||||
$cached_block = $this->drupalPlaceBlock('views_block:test_view_block-block_1');
|
$cached_block = $this->drupalPlaceBlock('views_block:test_view_block-block_1');
|
||||||
$this->drupalGet('test-page');
|
$this->drupalGet('test-page');
|
||||||
|
|
|
@ -31,7 +31,10 @@ class BlockContentListTest extends BlockContentTestBase {
|
||||||
* Tests the custom block listing page.
|
* Tests the custom block listing page.
|
||||||
*/
|
*/
|
||||||
public function testListing() {
|
public function testListing() {
|
||||||
$this->drupalLogin($this->drupalCreateUser(['administer blocks', 'translate configuration']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'administer blocks',
|
||||||
|
'translate configuration',
|
||||||
|
]));
|
||||||
$this->drupalGet('admin/structure/block/block-content');
|
$this->drupalGet('admin/structure/block/block-content');
|
||||||
|
|
||||||
// Test for the page title.
|
// Test for the page title.
|
||||||
|
|
|
@ -34,7 +34,10 @@ class BlockContentListViewsTest extends BlockContentTestBase {
|
||||||
* Tests the custom block listing page.
|
* Tests the custom block listing page.
|
||||||
*/
|
*/
|
||||||
public function testListing() {
|
public function testListing() {
|
||||||
$this->drupalLogin($this->drupalCreateUser(['administer blocks', 'translate configuration']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'administer blocks',
|
||||||
|
'translate configuration',
|
||||||
|
]));
|
||||||
$this->drupalGet('admin/structure/block/block-content');
|
$this->drupalGet('admin/structure/block/block-content');
|
||||||
|
|
||||||
// Test for the page title.
|
// Test for the page title.
|
||||||
|
|
|
@ -53,8 +53,24 @@ class BookBreadcrumbTest extends BrowserTestBase {
|
||||||
$this->drupalPlaceBlock('page_title_block');
|
$this->drupalPlaceBlock('page_title_block');
|
||||||
|
|
||||||
// Create users.
|
// Create users.
|
||||||
$this->bookAuthor = $this->drupalCreateUser(['create new books', 'create book content', 'edit own book content', 'add content to books']);
|
$this->bookAuthor = $this->drupalCreateUser([
|
||||||
$this->adminUser = $this->drupalCreateUser(['create new books', 'create book content', 'edit any book content', 'delete any book content', 'add content to books', 'administer blocks', 'administer permissions', 'administer book outlines', 'administer content types', 'administer site configuration']);
|
'create new books',
|
||||||
|
'create book content',
|
||||||
|
'edit own book content',
|
||||||
|
'add content to books',
|
||||||
|
]);
|
||||||
|
$this->adminUser = $this->drupalCreateUser([
|
||||||
|
'create new books',
|
||||||
|
'create book content',
|
||||||
|
'edit any book content',
|
||||||
|
'delete any book content',
|
||||||
|
'add content to books',
|
||||||
|
'administer blocks',
|
||||||
|
'administer permissions',
|
||||||
|
'administer book outlines',
|
||||||
|
'administer content types',
|
||||||
|
'administer site configuration',
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -46,7 +46,16 @@ class BookContentModerationTest extends BrowserTestBase {
|
||||||
$workflow->save();
|
$workflow->save();
|
||||||
|
|
||||||
// We need a user with additional content moderation permissions.
|
// We need a user with additional content moderation permissions.
|
||||||
$this->bookAuthor = $this->drupalCreateUser(['create new books', 'create book content', 'edit own book content', 'add content to books', 'access printer-friendly version', 'view any unpublished content', 'use editorial transition create_new_draft', 'use editorial transition publish']);
|
$this->bookAuthor = $this->drupalCreateUser([
|
||||||
|
'create new books',
|
||||||
|
'create book content',
|
||||||
|
'edit own book content',
|
||||||
|
'add content to books',
|
||||||
|
'access printer-friendly version',
|
||||||
|
'view any unpublished content',
|
||||||
|
'use editorial transition create_new_draft',
|
||||||
|
'use editorial transition publish',
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -61,10 +61,32 @@ class BookTest extends BrowserTestBase {
|
||||||
node_access_rebuild();
|
node_access_rebuild();
|
||||||
|
|
||||||
// Create users.
|
// Create users.
|
||||||
$this->bookAuthor = $this->drupalCreateUser(['create new books', 'create book content', 'edit own book content', 'add content to books']);
|
$this->bookAuthor = $this->drupalCreateUser([
|
||||||
$this->webUser = $this->drupalCreateUser(['access printer-friendly version', 'node test view']);
|
'create new books',
|
||||||
$this->webUserWithoutNodeAccess = $this->drupalCreateUser(['access printer-friendly version']);
|
'create book content',
|
||||||
$this->adminUser = $this->drupalCreateUser(['create new books', 'create book content', 'edit any book content', 'delete any book content', 'add content to books', 'administer blocks', 'administer permissions', 'administer book outlines', 'node test view', 'administer content types', 'administer site configuration']);
|
'edit own book content',
|
||||||
|
'add content to books',
|
||||||
|
]);
|
||||||
|
$this->webUser = $this->drupalCreateUser([
|
||||||
|
'access printer-friendly version',
|
||||||
|
'node test view',
|
||||||
|
]);
|
||||||
|
$this->webUserWithoutNodeAccess = $this->drupalCreateUser([
|
||||||
|
'access printer-friendly version',
|
||||||
|
]);
|
||||||
|
$this->adminUser = $this->drupalCreateUser([
|
||||||
|
'create new books',
|
||||||
|
'create book content',
|
||||||
|
'edit any book content',
|
||||||
|
'delete any book content',
|
||||||
|
'add content to books',
|
||||||
|
'administer blocks',
|
||||||
|
'administer permissions',
|
||||||
|
'administer book outlines',
|
||||||
|
'node test view',
|
||||||
|
'administer content types',
|
||||||
|
'administer site configuration',
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -557,7 +579,11 @@ class BookTest extends BrowserTestBase {
|
||||||
$this->createBook();
|
$this->createBook();
|
||||||
|
|
||||||
// Create administrator user.
|
// Create administrator user.
|
||||||
$administratorUser = $this->drupalCreateUser(['administer blocks', 'administer nodes', 'bypass node access']);
|
$administratorUser = $this->drupalCreateUser([
|
||||||
|
'administer blocks',
|
||||||
|
'administer nodes',
|
||||||
|
'bypass node access',
|
||||||
|
]);
|
||||||
$this->drupalLogin($administratorUser);
|
$this->drupalLogin($administratorUser);
|
||||||
|
|
||||||
// Enable the block with "Show block only on book pages" mode.
|
// Enable the block with "Show block only on book pages" mode.
|
||||||
|
|
|
@ -72,8 +72,16 @@ class CKEditorLoadingTest extends BrowserTestBase {
|
||||||
'name' => 'Article',
|
'name' => 'Article',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->untrustedUser = $this->drupalCreateUser(['create article content', 'edit any article content']);
|
$this->untrustedUser = $this->drupalCreateUser([
|
||||||
$this->normalUser = $this->drupalCreateUser(['create article content', 'edit any article content', 'use text format filtered_html', 'use text format full_html']);
|
'create article content',
|
||||||
|
'edit any article content',
|
||||||
|
]);
|
||||||
|
$this->normalUser = $this->drupalCreateUser([
|
||||||
|
'create article content',
|
||||||
|
'edit any article content',
|
||||||
|
'use text format filtered_html',
|
||||||
|
'use text format full_html',
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -57,7 +57,10 @@ class CKEditorStylesComboTranslationTest extends BrowserTestBase {
|
||||||
]);
|
]);
|
||||||
$editor->save();
|
$editor->save();
|
||||||
|
|
||||||
$this->adminUser = $this->drupalCreateUser(['administer filters', 'translate configuration']);
|
$this->adminUser = $this->drupalCreateUser([
|
||||||
|
'administer filters',
|
||||||
|
'translate configuration',
|
||||||
|
]);
|
||||||
|
|
||||||
ConfigurableLanguage::createFromLangcode('de')->save();
|
ConfigurableLanguage::createFromLangcode('de')->save();
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,11 @@ class CommentBookTest extends BrowserTestBase {
|
||||||
]);
|
]);
|
||||||
$comment->save();
|
$comment->save();
|
||||||
|
|
||||||
$commenting_user = $this->drupalCreateUser(['access printer-friendly version', 'access comments', 'post comments']);
|
$commenting_user = $this->drupalCreateUser([
|
||||||
|
'access printer-friendly version',
|
||||||
|
'access comments',
|
||||||
|
'post comments',
|
||||||
|
]);
|
||||||
$this->drupalLogin($commenting_user);
|
$this->drupalLogin($commenting_user);
|
||||||
|
|
||||||
$this->drupalGet('node/' . $book_node->id());
|
$this->drupalGet('node/' . $book_node->id());
|
||||||
|
|
|
@ -191,7 +191,10 @@ class CommentFieldsTest extends CommentTestBase {
|
||||||
*/
|
*/
|
||||||
public function testCommentInstallAfterContentModule() {
|
public function testCommentInstallAfterContentModule() {
|
||||||
// Create a user to do module administration.
|
// Create a user to do module administration.
|
||||||
$this->adminUser = $this->drupalCreateUser(['access administration pages', 'administer modules']);
|
$this->adminUser = $this->drupalCreateUser([
|
||||||
|
'access administration pages',
|
||||||
|
'administer modules',
|
||||||
|
]);
|
||||||
$this->drupalLogin($this->adminUser);
|
$this->drupalLogin($this->adminUser);
|
||||||
|
|
||||||
// Drop default comment field added in CommentTestBase::setup().
|
// Drop default comment field added in CommentTestBase::setup().
|
||||||
|
@ -233,7 +236,12 @@ class CommentFieldsTest extends CommentTestBase {
|
||||||
// Try to post a comment on each node. A failure will be triggered if the
|
// Try to post a comment on each node. A failure will be triggered if the
|
||||||
// comment body is missing on one of these forms, due to postComment()
|
// comment body is missing on one of these forms, due to postComment()
|
||||||
// asserting that the body is actually posted correctly.
|
// asserting that the body is actually posted correctly.
|
||||||
$this->webUser = $this->drupalCreateUser(['access content', 'access comments', 'post comments', 'skip comment approval']);
|
$this->webUser = $this->drupalCreateUser([
|
||||||
|
'access content',
|
||||||
|
'access comments',
|
||||||
|
'post comments',
|
||||||
|
'skip comment approval',
|
||||||
|
]);
|
||||||
$this->drupalLogin($this->webUser);
|
$this->drupalLogin($this->webUser);
|
||||||
$this->postComment($book_node, $this->randomMachineName(), $this->randomMachineName());
|
$this->postComment($book_node, $this->randomMachineName(), $this->randomMachineName());
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,17 @@ class CommentLanguageTest extends BrowserTestBase {
|
||||||
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
|
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
|
||||||
|
|
||||||
// Create and log in user.
|
// Create and log in user.
|
||||||
$admin_user = $this->drupalCreateUser(['administer site configuration', 'administer languages', 'access administration pages', 'administer content types', 'administer comments', 'create article content', 'access comments', 'post comments', 'skip comment approval']);
|
$admin_user = $this->drupalCreateUser([
|
||||||
|
'administer site configuration',
|
||||||
|
'administer languages',
|
||||||
|
'access administration pages',
|
||||||
|
'administer content types',
|
||||||
|
'administer comments',
|
||||||
|
'create article content',
|
||||||
|
'access comments',
|
||||||
|
'post comments',
|
||||||
|
'skip comment approval',
|
||||||
|
]);
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Add language.
|
// Add language.
|
||||||
|
|
|
@ -128,7 +128,12 @@ class CommentPreviewTest extends CommentTestBase {
|
||||||
* Tests comment edit, preview, and save.
|
* Tests comment edit, preview, and save.
|
||||||
*/
|
*/
|
||||||
public function testCommentEditPreviewSave() {
|
public function testCommentEditPreviewSave() {
|
||||||
$web_user = $this->drupalCreateUser(['access comments', 'post comments', 'skip comment approval', 'edit own comments']);
|
$web_user = $this->drupalCreateUser([
|
||||||
|
'access comments',
|
||||||
|
'post comments',
|
||||||
|
'skip comment approval',
|
||||||
|
'edit own comments',
|
||||||
|
]);
|
||||||
$this->drupalLogin($this->adminUser);
|
$this->drupalLogin($this->adminUser);
|
||||||
$this->setCommentPreview(DRUPAL_OPTIONAL);
|
$this->setCommentPreview(DRUPAL_OPTIONAL);
|
||||||
$this->setCommentForm(TRUE);
|
$this->setCommentForm(TRUE);
|
||||||
|
|
|
@ -35,7 +35,9 @@ class ConfigDependencyWebTest extends BrowserTestBase {
|
||||||
* @see \Drupal\Core\Config\Entity\ConfigDependencyDeleteFormTrait
|
* @see \Drupal\Core\Config\Entity\ConfigDependencyDeleteFormTrait
|
||||||
*/
|
*/
|
||||||
public function testConfigDependencyDeleteFormTrait() {
|
public function testConfigDependencyDeleteFormTrait() {
|
||||||
$this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'administer site configuration',
|
||||||
|
]));
|
||||||
|
|
||||||
/** @var \Drupal\Core\Config\Entity\ConfigEntityStorage $storage */
|
/** @var \Drupal\Core\Config\Entity\ConfigEntityStorage $storage */
|
||||||
$storage = $this->container->get('entity_type.manager')->getStorage('config_test');
|
$storage = $this->container->get('entity_type.manager')->getStorage('config_test');
|
||||||
|
|
|
@ -25,7 +25,9 @@ class ConfigEntityFormOverrideTest extends BrowserTestBase {
|
||||||
* Tests that overrides do not affect forms or listing screens.
|
* Tests that overrides do not affect forms or listing screens.
|
||||||
*/
|
*/
|
||||||
public function testFormsWithOverrides() {
|
public function testFormsWithOverrides() {
|
||||||
$this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'administer site configuration',
|
||||||
|
]));
|
||||||
|
|
||||||
$original_label = 'Default';
|
$original_label = 'Default';
|
||||||
$overridden_label = 'Overridden label';
|
$overridden_label = 'Overridden label';
|
||||||
|
|
|
@ -41,7 +41,10 @@ class ConfigEntityListMultilingualTest extends BrowserTestBase {
|
||||||
*/
|
*/
|
||||||
public function testListUI() {
|
public function testListUI() {
|
||||||
// Log in as an administrative user to access the full menu trail.
|
// Log in as an administrative user to access the full menu trail.
|
||||||
$this->drupalLogin($this->drupalCreateUser(['access administration pages', 'administer site configuration']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'access administration pages',
|
||||||
|
'administer site configuration',
|
||||||
|
]));
|
||||||
|
|
||||||
// Get the list page.
|
// Get the list page.
|
||||||
$this->drupalGet('admin/structure/config_test');
|
$this->drupalGet('admin/structure/config_test');
|
||||||
|
|
|
@ -156,7 +156,10 @@ class ConfigEntityListTest extends BrowserTestBase {
|
||||||
*/
|
*/
|
||||||
public function testListUI() {
|
public function testListUI() {
|
||||||
// Log in as an administrative user to access the full menu trail.
|
// Log in as an administrative user to access the full menu trail.
|
||||||
$this->drupalLogin($this->drupalCreateUser(['access administration pages', 'administer site configuration']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'access administration pages',
|
||||||
|
'administer site configuration',
|
||||||
|
]));
|
||||||
|
|
||||||
// Get the list callback page.
|
// Get the list callback page.
|
||||||
$this->drupalGet('admin/structure/config_test');
|
$this->drupalGet('admin/structure/config_test');
|
||||||
|
@ -254,7 +257,9 @@ class ConfigEntityListTest extends BrowserTestBase {
|
||||||
* Test paging.
|
* Test paging.
|
||||||
*/
|
*/
|
||||||
public function testPager() {
|
public function testPager() {
|
||||||
$this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'administer site configuration',
|
||||||
|
]));
|
||||||
|
|
||||||
$storage = \Drupal::service('entity_type.manager')->getListBuilder('config_test')->getStorage();
|
$storage = \Drupal::service('entity_type.manager')->getListBuilder('config_test')->getStorage();
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,9 @@ class ConfigEntityStatusUITest extends BrowserTestBase {
|
||||||
* Tests status operations.
|
* Tests status operations.
|
||||||
*/
|
*/
|
||||||
public function testCRUD() {
|
public function testCRUD() {
|
||||||
$this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'administer site configuration',
|
||||||
|
]));
|
||||||
|
|
||||||
$id = strtolower($this->randomMachineName());
|
$id = strtolower($this->randomMachineName());
|
||||||
$edit = [
|
$edit = [
|
||||||
|
|
|
@ -236,7 +236,9 @@ class ConfigEntityTest extends BrowserTestBase {
|
||||||
* Tests CRUD operations through the UI.
|
* Tests CRUD operations through the UI.
|
||||||
*/
|
*/
|
||||||
public function testCRUDUI() {
|
public function testCRUDUI() {
|
||||||
$this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'administer site configuration',
|
||||||
|
]));
|
||||||
|
|
||||||
$id = strtolower($this->randomMachineName());
|
$id = strtolower($this->randomMachineName());
|
||||||
$label1 = $this->randomMachineName();
|
$label1 = $this->randomMachineName();
|
||||||
|
|
|
@ -21,7 +21,10 @@ class ConfigFormOverrideTest extends BrowserTestBase {
|
||||||
* Tests that overrides do not affect forms.
|
* Tests that overrides do not affect forms.
|
||||||
*/
|
*/
|
||||||
public function testFormsWithOverrides() {
|
public function testFormsWithOverrides() {
|
||||||
$this->drupalLogin($this->drupalCreateUser(['access administration pages', 'administer site configuration']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'access administration pages',
|
||||||
|
'administer site configuration',
|
||||||
|
]));
|
||||||
|
|
||||||
$overridden_name = 'Site name global conf override';
|
$overridden_name = 'Site name global conf override';
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,11 @@ class ConfigInstallWebTest extends BrowserTestBase {
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$this->adminUser = $this->drupalCreateUser(['administer modules', 'administer themes', 'administer site configuration']);
|
$this->adminUser = $this->drupalCreateUser([
|
||||||
|
'administer modules',
|
||||||
|
'administer themes',
|
||||||
|
'administer site configuration',
|
||||||
|
]);
|
||||||
|
|
||||||
// Ensure the global variable being asserted by this test does not exist;
|
// Ensure the global variable being asserted by this test does not exist;
|
||||||
// a previous test executed in this request/process might have set it.
|
// a previous test executed in this request/process might have set it.
|
||||||
|
|
|
@ -40,7 +40,10 @@ class ConfigLanguageOverrideWebTest extends BrowserTestBase {
|
||||||
* Tests translating the site name.
|
* Tests translating the site name.
|
||||||
*/
|
*/
|
||||||
public function testSiteNameTranslation() {
|
public function testSiteNameTranslation() {
|
||||||
$adminUser = $this->drupalCreateUser(['administer site configuration', 'administer languages']);
|
$adminUser = $this->drupalCreateUser([
|
||||||
|
'administer site configuration',
|
||||||
|
'administer languages',
|
||||||
|
]);
|
||||||
$this->drupalLogin($adminUser);
|
$this->drupalLogin($adminUser);
|
||||||
|
|
||||||
// Add a custom language.
|
// Add a custom language.
|
||||||
|
|
|
@ -25,7 +25,9 @@ class ConfigEntityTest extends WebDriverTestBase {
|
||||||
* Tests ajax operations through the UI on 'Add' page.
|
* Tests ajax operations through the UI on 'Add' page.
|
||||||
*/
|
*/
|
||||||
public function testAjaxOnAddPage() {
|
public function testAjaxOnAddPage() {
|
||||||
$this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'administer site configuration',
|
||||||
|
]));
|
||||||
|
|
||||||
$page = $this->getSession()->getPage();
|
$page = $this->getSession()->getPage();
|
||||||
$assert_session = $this->assertSession();
|
$assert_session = $this->assertSession();
|
||||||
|
|
|
@ -57,11 +57,19 @@ class ContactPersonalTest extends BrowserTestBase {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
// Create an admin user.
|
// Create an admin user.
|
||||||
$this->adminUser = $this->drupalCreateUser(['administer contact forms', 'administer users', 'administer account settings', 'access site reports']);
|
$this->adminUser = $this->drupalCreateUser([
|
||||||
|
'administer contact forms',
|
||||||
|
'administer users',
|
||||||
|
'administer account settings',
|
||||||
|
'access site reports',
|
||||||
|
]);
|
||||||
|
|
||||||
// Create some normal users with their contact forms enabled by default.
|
// Create some normal users with their contact forms enabled by default.
|
||||||
$this->config('contact.settings')->set('user_default_enabled', TRUE)->save();
|
$this->config('contact.settings')->set('user_default_enabled', TRUE)->save();
|
||||||
$this->webUser = $this->drupalCreateUser(['access user profiles', 'access user contact forms']);
|
$this->webUser = $this->drupalCreateUser([
|
||||||
|
'access user profiles',
|
||||||
|
'access user contact forms',
|
||||||
|
]);
|
||||||
$this->contactUser = $this->drupalCreateUser();
|
$this->contactUser = $this->drupalCreateUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,9 @@ class ContactSitewideTest extends BrowserTestBase {
|
||||||
*/
|
*/
|
||||||
public function testSiteWideContact() {
|
public function testSiteWideContact() {
|
||||||
// Tests name and email fields for authenticated and anonymous users.
|
// Tests name and email fields for authenticated and anonymous users.
|
||||||
$this->drupalLogin($this->drupalCreateUser(['access site-wide contact form']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'access site-wide contact form',
|
||||||
|
]));
|
||||||
$this->drupalGet('contact');
|
$this->drupalGet('contact');
|
||||||
|
|
||||||
// Ensure that there is no textfield for name.
|
// Ensure that there is no textfield for name.
|
||||||
|
|
|
@ -54,7 +54,12 @@ class ModeratedContentViewTest extends BrowserTestBase {
|
||||||
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'article');
|
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'article');
|
||||||
$workflow->save();
|
$workflow->save();
|
||||||
|
|
||||||
$this->adminUser = $this->drupalCreateUser(['access administration pages', 'view any unpublished content', 'administer nodes', 'bypass node access']);
|
$this->adminUser = $this->drupalCreateUser([
|
||||||
|
'access administration pages',
|
||||||
|
'view any unpublished content',
|
||||||
|
'administer nodes',
|
||||||
|
'bypass node access',
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -66,7 +66,10 @@ class ViewsModerationStateFilterTest extends ViewTestBase {
|
||||||
$new_workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example_c');
|
$new_workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example_c');
|
||||||
$new_workflow->save();
|
$new_workflow->save();
|
||||||
|
|
||||||
$this->drupalLogin($this->drupalCreateUser(['administer workflows', 'administer views']));
|
$this->drupalLogin($this->drupalCreateUser([
|
||||||
|
'administer workflows',
|
||||||
|
'administer views',
|
||||||
|
]));
|
||||||
|
|
||||||
$this->container->get('module_installer')->install(['content_moderation_test_views']);
|
$this->container->get('module_installer')->install(['content_moderation_test_views']);
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,12 @@ class ContentTranslationEntityBundleUITest extends BrowserTestBase {
|
||||||
|
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$user = $this->drupalCreateUser(['access administration pages', 'administer languages', 'administer content translation', 'administer content types']);
|
$user = $this->drupalCreateUser([
|
||||||
|
'access administration pages',
|
||||||
|
'administer languages',
|
||||||
|
'administer content translation',
|
||||||
|
'administer content types',
|
||||||
|
]);
|
||||||
$this->drupalLogin($user);
|
$this->drupalLogin($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,12 @@ class ContentTranslationOperationsTest extends NodeTestBase {
|
||||||
\Drupal::service('router.builder')->rebuild();
|
\Drupal::service('router.builder')->rebuild();
|
||||||
|
|
||||||
$this->baseUser1 = $this->drupalCreateUser(['access content overview']);
|
$this->baseUser1 = $this->drupalCreateUser(['access content overview']);
|
||||||
$this->baseUser2 = $this->drupalCreateUser(['access content overview', 'create content translations', 'update content translations', 'delete content translations']);
|
$this->baseUser2 = $this->drupalCreateUser([
|
||||||
|
'access content overview',
|
||||||
|
'create content translations',
|
||||||
|
'update content translations',
|
||||||
|
'delete content translations',
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -49,7 +49,17 @@ class ContentTranslationSettingsTest extends BrowserTestBase {
|
||||||
$this->addDefaultCommentField('node', 'article', 'comment_article', CommentItemInterface::OPEN, 'comment_article');
|
$this->addDefaultCommentField('node', 'article', 'comment_article', CommentItemInterface::OPEN, 'comment_article');
|
||||||
$this->addDefaultCommentField('node', 'page', 'comment_page');
|
$this->addDefaultCommentField('node', 'page', 'comment_page');
|
||||||
|
|
||||||
$admin_user = $this->drupalCreateUser(['access administration pages', 'administer languages', 'administer content translation', 'administer content types', 'administer node fields', 'administer comment fields', 'administer comments', 'administer comment types', 'administer account settings']);
|
$admin_user = $this->drupalCreateUser([
|
||||||
|
'access administration pages',
|
||||||
|
'administer languages',
|
||||||
|
'administer content translation',
|
||||||
|
'administer content types',
|
||||||
|
'administer node fields',
|
||||||
|
'administer comment fields',
|
||||||
|
'administer comments',
|
||||||
|
'administer comment types',
|
||||||
|
'administer account settings',
|
||||||
|
]);
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,11 @@ class ContentTranslationWorkflowsTest extends ContentTranslationTestBase {
|
||||||
$ops = ['create' => t('Add'), 'update' => t('Edit'), 'delete' => t('Delete')];
|
$ops = ['create' => t('Add'), 'update' => t('Edit'), 'delete' => t('Delete')];
|
||||||
$translations_url = $this->entity->toUrl('drupal:content-translation-overview');
|
$translations_url = $this->entity->toUrl('drupal:content-translation-overview');
|
||||||
foreach ($ops as $current_op => $item) {
|
foreach ($ops as $current_op => $item) {
|
||||||
$user = $this->drupalCreateUser([$this->getTranslatePermission(), "$current_op content translations", 'view test entity']);
|
$user = $this->drupalCreateUser([
|
||||||
|
$this->getTranslatePermission(),
|
||||||
|
"$current_op content translations",
|
||||||
|
'view test entity',
|
||||||
|
]);
|
||||||
$this->drupalLogin($user);
|
$this->drupalLogin($user);
|
||||||
$this->drupalGet($translations_url);
|
$this->drupalGet($translations_url);
|
||||||
|
|
||||||
|
|
|
@ -66,8 +66,15 @@ class ContextualDynamicContextTest extends BrowserTestBase {
|
||||||
ConfigurableLanguage::createFromLangcode('it')->save();
|
ConfigurableLanguage::createFromLangcode('it')->save();
|
||||||
$this->rebuildContainer();
|
$this->rebuildContainer();
|
||||||
|
|
||||||
$this->editorUser = $this->drupalCreateUser(['access content', 'access contextual links', 'edit any article content']);
|
$this->editorUser = $this->drupalCreateUser([
|
||||||
$this->authenticatedUser = $this->drupalCreateUser(['access content', 'access contextual links']);
|
'access content',
|
||||||
|
'access contextual links',
|
||||||
|
'edit any article content',
|
||||||
|
]);
|
||||||
|
$this->authenticatedUser = $this->drupalCreateUser([
|
||||||
|
'access content',
|
||||||
|
'access contextual links',
|
||||||
|
]);
|
||||||
$this->anonymousUser = $this->drupalCreateUser(['access content']);
|
$this->anonymousUser = $this->drupalCreateUser(['access content']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,12 @@ class DbLogTest extends BrowserTestBase {
|
||||||
$this->drupalPlaceBlock('page_title_block');
|
$this->drupalPlaceBlock('page_title_block');
|
||||||
|
|
||||||
// Create users with specific permissions.
|
// 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([]);
|
$this->webUser = $this->drupalCreateUser([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,9 +105,23 @@ class EditorLoadingTest extends BrowserTestBase {
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
// Create 3 users, each with access to different text formats.
|
// Create 3 users, each with access to different text formats.
|
||||||
$this->untrustedUser = $this->drupalCreateUser(['create article content', 'edit any article content']);
|
$this->untrustedUser = $this->drupalCreateUser([
|
||||||
$this->normalUser = $this->drupalCreateUser(['create article content', 'edit any article content', 'use text format filtered_html']);
|
'create article content',
|
||||||
$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']);
|
'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 @@ class EditorUploadImageScaleTest extends BrowserTestBase {
|
||||||
])->save();
|
])->save();
|
||||||
|
|
||||||
// Create admin user.
|
// 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);
|
$this->drupalLogin($this->adminUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,14 @@ class BooleanFormatterSettingsTest extends BrowserTestBase {
|
||||||
$type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
|
$type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
|
||||||
$this->bundle = $type->id();
|
$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->drupalLogin($admin_user);
|
||||||
|
|
||||||
$this->fieldName = mb_strtolower($this->randomMachineName(8));
|
$this->fieldName = mb_strtolower($this->randomMachineName(8));
|
||||||
|
|
|
@ -92,7 +92,10 @@ class EntityReferenceAutoCreateTest extends BrowserTestBase {
|
||||||
])
|
])
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
$account = $this->drupalCreateUser(['access content', "create $this->referencingType content"]);
|
$account = $this->drupalCreateUser([
|
||||||
|
'access content',
|
||||||
|
"create $this->referencingType content",
|
||||||
|
]);
|
||||||
$this->drupalLogin($account);
|
$this->drupalLogin($account);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,13 @@ class EntityReferenceFieldDefaultValueTest extends BrowserTestBase {
|
||||||
$this->drupalCreateContentType(['type' => 'referenced_content']);
|
$this->drupalCreateContentType(['type' => 'referenced_content']);
|
||||||
|
|
||||||
// Create admin user.
|
// 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);
|
$this->drupalLogin($this->adminUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,9 @@ class EntityReferenceFieldTranslatedReferenceViewTest extends BrowserTestBase {
|
||||||
$this->setUpEntityReferenceField();
|
$this->setUpEntityReferenceField();
|
||||||
$this->createContent();
|
$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 @@ class EntityReferenceFileUploadTest extends BrowserTestBase {
|
||||||
* Tests that the autocomplete input element does not cause ajax fatal.
|
* Tests that the autocomplete input element does not cause ajax fatal.
|
||||||
*/
|
*/
|
||||||
public function testFileUpload() {
|
public function testFileUpload() {
|
||||||
$user1 = $this->drupalCreateUser(['access content', "create $this->referencingType content"]);
|
$user1 = $this->drupalCreateUser([
|
||||||
|
'access content',
|
||||||
|
"create $this->referencingType content",
|
||||||
|
]);
|
||||||
$this->drupalLogin($user1);
|
$this->drupalLogin($user1);
|
||||||
|
|
||||||
$test_file = current($this->getTestFiles('text'));
|
$test_file = current($this->getTestFiles('text'));
|
||||||
|
|
|
@ -59,7 +59,11 @@ class EntityReferenceIntegrationTest extends BrowserTestBase {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
// Create a test user.
|
// 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);
|
$this->drupalLogin($web_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,10 @@ class FieldHelpTest extends BrowserTestBase {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
// Create the admin user.
|
// 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() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
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->drupalLogin($web_user);
|
||||||
|
|
||||||
$this->fieldStorageSingle = [
|
$this->fieldStorageSingle = [
|
||||||
|
|
|
@ -28,7 +28,10 @@ class NestedFormTest extends FieldTestBase {
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
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->drupalLogin($web_user);
|
||||||
|
|
||||||
$this->fieldStorageSingle = [
|
$this->fieldStorageSingle = [
|
||||||
|
|
|
@ -96,7 +96,10 @@ class ReEnableModuleFieldTest extends BrowserTestBase {
|
||||||
|
|
||||||
// Test that the module can't be uninstalled from the UI while there is data
|
// Test that the module can't be uninstalled from the UI while there is data
|
||||||
// for its fields.
|
// 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->drupalLogin($admin_user);
|
||||||
$this->drupalGet('admin/modules/uninstall');
|
$this->drupalGet('admin/modules/uninstall');
|
||||||
$this->assertText("The Telephone number field type is used in the following field: node.field_telephone");
|
$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() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
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);
|
$this->drupalLogin($this->webUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,10 @@ class TranslationWebTest extends FieldTestBase {
|
||||||
* Tests field translations when creating a new revision.
|
* Tests field translations when creating a new revision.
|
||||||
*/
|
*/
|
||||||
public function testFieldFormTranslationRevisions() {
|
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);
|
$this->drupalLogin($web_user);
|
||||||
|
|
||||||
// Prepare the field translations.
|
// Prepare the field translations.
|
||||||
|
|
|
@ -54,7 +54,17 @@ class FieldUIDeleteTest extends BrowserTestBase {
|
||||||
$this->drupalPlaceBlock('page_title_block');
|
$this->drupalPlaceBlock('page_title_block');
|
||||||
|
|
||||||
// Create a test user.
|
// 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);
|
$this->drupalLogin($admin_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,11 @@ class FieldUIIndentationTest extends BrowserTestBase {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
// Create a test user.
|
// 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);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Create Basic page node type.
|
// Create Basic page node type.
|
||||||
|
|
|
@ -49,7 +49,20 @@ class ManageDisplayTest extends BrowserTestBase {
|
||||||
$this->drupalPlaceBlock('local_tasks_block');
|
$this->drupalPlaceBlock('local_tasks_block');
|
||||||
|
|
||||||
// Create a test user.
|
// 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);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Create content type, with underscores.
|
// Create content type, with underscores.
|
||||||
|
|
|
@ -81,7 +81,20 @@ class ManageFieldsFunctionalTest extends BrowserTestBase {
|
||||||
$this->drupalPlaceBlock('page_title_block');
|
$this->drupalPlaceBlock('page_title_block');
|
||||||
|
|
||||||
// Create a test user.
|
// 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);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Create content type, with underscores.
|
// Create content type, with underscores.
|
||||||
|
|
|
@ -51,7 +51,17 @@ class ManageDisplayTest extends WebDriverTestBase {
|
||||||
$this->drupalPlaceBlock('system_breadcrumb_block');
|
$this->drupalPlaceBlock('system_breadcrumb_block');
|
||||||
|
|
||||||
// Create a test user.
|
// 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);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Create content type, with underscores.
|
// Create content type, with underscores.
|
||||||
|
|
|
@ -46,7 +46,18 @@ abstract class FileFieldTestBase extends BrowserTestBase {
|
||||||
*/
|
*/
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::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->drupalLogin($this->adminUser);
|
||||||
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
|
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,10 @@ class FileListingTest extends FileFieldTestBase {
|
||||||
->set('make_unused_managed_files_temporary', TRUE)
|
->set('make_unused_managed_files_temporary', TRUE)
|
||||||
->save();
|
->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->baseUser = $this->drupalCreateUser();
|
||||||
$this->createFileField('file', 'node', 'article', [], ['file_extensions' => 'txt png']);
|
$this->createFileField('file', 'node', 'article', [], ['file_extensions' => 'txt png']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,18 @@ class FileFieldWidgetTest extends WebDriverTestBase {
|
||||||
*/
|
*/
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::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->drupalLogin($this->adminUser);
|
||||||
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
|
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,18 @@ class FileManagedFileElementTest extends WebDriverTestBase {
|
||||||
*/
|
*/
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::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->drupalLogin($this->adminUser);
|
||||||
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
|
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,10 @@ class FilterAdminTest extends BrowserTestBase {
|
||||||
'access site reports',
|
'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('authenticated', [$basic_html_format->getPermissionName()]);
|
||||||
user_role_grant_permissions('anonymous', [$restricted_html_format->getPermissionName()]);
|
user_role_grant_permissions('anonymous', [$restricted_html_format->getPermissionName()]);
|
||||||
$this->drupalLogin($this->adminUser);
|
$this->drupalLogin($this->adminUser);
|
||||||
|
|
|
@ -44,7 +44,10 @@ class FilterDefaultFormatTest extends BrowserTestBase {
|
||||||
}
|
}
|
||||||
list($first_format, $second_format) = $formats;
|
list($first_format, $second_format) = $formats;
|
||||||
$second_format_permission = $second_format->getPermissionName();
|
$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]);
|
$second_user = $this->drupalCreateUser([$second_format_permission]);
|
||||||
|
|
||||||
// Adjust the weights so that the first and second formats (in that order)
|
// Adjust the weights so that the first and second formats (in that order)
|
||||||
|
|
|
@ -36,7 +36,11 @@ class FilterHooksTest extends BrowserTestBase {
|
||||||
$type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
|
$type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
|
||||||
$node_permission = "create $type_name content";
|
$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);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Add a text format.
|
// Add a text format.
|
||||||
|
|
|
@ -46,7 +46,11 @@ class FilterSecurityTest extends BrowserTestBase {
|
||||||
$filtered_html_permission = $filtered_html_format->getPermissionName();
|
$filtered_html_permission = $filtered_html_format->getPermissionName();
|
||||||
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, [$filtered_html_permission]);
|
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);
|
$this->drupalLogin($this->adminUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,13 @@ class ForumIndexTest extends BrowserTestBase {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
// Create a test user.
|
// 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);
|
$this->drupalLogin($web_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,12 @@ class ForumNodeAccessTest extends BrowserTestBase {
|
||||||
// Create some users.
|
// Create some users.
|
||||||
$access_user = $this->drupalCreateUser(['node test view']);
|
$access_user = $this->drupalCreateUser(['node test view']);
|
||||||
$no_access_user = $this->drupalCreateUser();
|
$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);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
|
|
|
@ -224,7 +224,11 @@ class ForumTest extends BrowserTestBase {
|
||||||
$this->assertEquals('6', $elements[0]->getText(), 'Number of posts found.');
|
$this->assertEquals('6', $elements[0]->getText(), 'Number of posts found.');
|
||||||
|
|
||||||
// Test loading multiple forum nodes on the front page.
|
// 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->drupalPostForm('admin/structure/types/manage/forum', ['options[promote]' => 'promote'], t('Save content type'));
|
||||||
$this->createForumTopic($this->forum, FALSE);
|
$this->createForumTopic($this->forum, FALSE);
|
||||||
$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.
|
* Tests if forum module uninstallation properly deletes the field.
|
||||||
*/
|
*/
|
||||||
public function testForumUninstallWithField() {
|
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.
|
// Ensure that the field exists before uninstallation.
|
||||||
$field_storage = FieldStorageConfig::loadByName('node', 'taxonomy_forums');
|
$field_storage = FieldStorageConfig::loadByName('node', 'taxonomy_forums');
|
||||||
$this->assertNotNull($field_storage, 'The taxonomy_forums field storage exists.');
|
$this->assertNotNull($field_storage, 'The taxonomy_forums field storage exists.');
|
||||||
|
|
|
@ -49,7 +49,11 @@ class HelpTest extends BrowserTestBase {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
// Create users.
|
// 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([]);
|
$this->anyUser = $this->drupalCreateUser([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,10 @@ class HistoryTest extends BrowserTestBase {
|
||||||
|
|
||||||
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
|
$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->drupalLogin($this->user);
|
||||||
$this->testNode = $this->drupalCreateNode(['type' => 'page', 'uid' => $this->user->id()]);
|
$this->testNode = $this->drupalCreateNode(['type' => 'page', 'uid' => $this->user->id()]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,19 @@ abstract class ImageFieldTestBase extends BrowserTestBase {
|
||||||
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
|
$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);
|
$this->drupalLogin($this->adminUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1029,7 +1029,10 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||||
$this->assertInstanceOf(TranslatableInterface::class, $entity);
|
$this->assertInstanceOf(TranslatableInterface::class, $entity);
|
||||||
$this->assertFalse($entity->isTranslatable());
|
$this->assertFalse($entity->isTranslatable());
|
||||||
// Set up a test user with permission to view and update the test entity.
|
// 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::HEADERS]['Accept'] = 'application/vnd.api+json';
|
||||||
$request_options[RequestOptions::AUTH] = [
|
$request_options[RequestOptions::AUTH] = [
|
||||||
$user->getAccountName(),
|
$user->getAccountName(),
|
||||||
|
|
|
@ -19,7 +19,11 @@ class LanguageBlockSettingsVisibilityTest extends BrowserTestBase {
|
||||||
protected $defaultTheme = 'stark';
|
protected $defaultTheme = 'stark';
|
||||||
|
|
||||||
public function testUnnecessaryLanguageSettingsVisibility() {
|
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->drupalLogin($admin_user);
|
||||||
$this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'hu'], t('Add language'));
|
$this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'hu'], t('Add language'));
|
||||||
$this->drupalGet('admin/structure/block/add/system_menu_block:admin/stark');
|
$this->drupalGet('admin/structure/block/add/system_menu_block:admin/stark');
|
||||||
|
|
|
@ -25,7 +25,10 @@ class LanguageBrowserDetectionTest extends BrowserTestBase {
|
||||||
*/
|
*/
|
||||||
public function testUIBrowserLanguageMappings() {
|
public function testUIBrowserLanguageMappings() {
|
||||||
// User to manage languages.
|
// 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);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Check that the configure link exists.
|
// Check that the configure link exists.
|
||||||
|
|
|
@ -35,7 +35,11 @@ class LanguageConfigurationElementTest extends BrowserTestBase {
|
||||||
|
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
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);
|
$this->drupalLogin($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,10 @@ class LanguageConfigurationTest extends BrowserTestBase {
|
||||||
$this->assertEqual(ConfigurableLanguage::load('en')->getWeight(), 0, 'The English language has a weight of 0.');
|
$this->assertEqual(ConfigurableLanguage::load('en')->getWeight(), 0, 'The English language has a weight of 0.');
|
||||||
|
|
||||||
// User to add and remove language.
|
// 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->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Check if the Default English language has no path prefix.
|
// Check if the Default English language has no path prefix.
|
||||||
|
@ -157,7 +160,10 @@ class LanguageConfigurationTest extends BrowserTestBase {
|
||||||
*/
|
*/
|
||||||
public function testLanguageConfigurationWeight() {
|
public function testLanguageConfigurationWeight() {
|
||||||
// User to add and remove language.
|
// 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->drupalLogin($admin_user);
|
||||||
$this->checkConfigurableLanguageWeight();
|
$this->checkConfigurableLanguageWeight();
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,10 @@ class LanguageCustomLanguageConfigurationTest extends BrowserTestBase {
|
||||||
public function testLanguageConfiguration() {
|
public function testLanguageConfiguration() {
|
||||||
|
|
||||||
// Create user with permissions to add and remove languages.
|
// 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);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Add custom language.
|
// Add custom language.
|
||||||
|
|
|
@ -30,7 +30,10 @@ class LanguageListModuleInstallTest extends BrowserTestBase {
|
||||||
public function testModuleInstallLanguageList() {
|
public function testModuleInstallLanguageList() {
|
||||||
// Since LanguageManager::getLanguages() uses static caches we need to do
|
// Since LanguageManager::getLanguages() uses static caches we need to do
|
||||||
// this by enabling the module using the UI.
|
// 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);
|
$this->drupalLogin($admin_user);
|
||||||
$edit = [];
|
$edit = [];
|
||||||
$edit['modules[language][enable]'] = 'language';
|
$edit['modules[language][enable]'] = 'language';
|
||||||
|
|
|
@ -33,7 +33,10 @@ class LanguageListTest extends BrowserTestBase {
|
||||||
public function testLanguageList() {
|
public function testLanguageList() {
|
||||||
|
|
||||||
// User to add and remove language.
|
// 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->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Get the weight of the last language.
|
// Get the weight of the last language.
|
||||||
|
|
|
@ -38,7 +38,10 @@ class LanguageLocaleListTest extends BrowserTestBase {
|
||||||
*/
|
*/
|
||||||
public function testLanguageLocaleList() {
|
public function testLanguageLocaleList() {
|
||||||
// User to add and remove language.
|
// 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->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Add predefined language.
|
// Add predefined language.
|
||||||
|
|
|
@ -31,7 +31,12 @@ class LanguageNegotiationInfoTest extends BrowserTestBase {
|
||||||
*/
|
*/
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
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->drupalLogin($admin_user);
|
||||||
$this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'it'], t('Add language'));
|
$this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'it'], t('Add language'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,11 @@ class LanguagePathMonolingualTest extends BrowserTestBase {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
// Create and log in user.
|
// 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);
|
$this->drupalLogin($web_user);
|
||||||
|
|
||||||
// Enable French language.
|
// Enable French language.
|
||||||
|
|
|
@ -38,7 +38,11 @@ class LanguageSwitchingTest extends BrowserTestBase {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
// Create and log in user.
|
// 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);
|
$this->drupalLogin($admin_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,10 @@ class LanguageTourTest extends TourTestBase {
|
||||||
*/
|
*/
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->adminUser = $this->drupalCreateUser(['administer languages', 'access tour']);
|
$this->adminUser = $this->drupalCreateUser([
|
||||||
|
'administer languages',
|
||||||
|
'access tour',
|
||||||
|
]);
|
||||||
$this->drupalLogin($this->adminUser);
|
$this->drupalLogin($this->adminUser);
|
||||||
$this->drupalPlaceBlock('local_actions_block');
|
$this->drupalPlaceBlock('local_actions_block');
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,12 @@ class LanguageUILanguageNegotiationTest extends BrowserTestBase {
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
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);
|
$this->drupalLogin($this->adminUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,10 @@ class LanguageUrlRewritingTest extends BrowserTestBase {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
// Create and log in user.
|
// 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);
|
$this->drupalLogin($this->webUser);
|
||||||
|
|
||||||
// Install French language.
|
// Install French language.
|
||||||
|
|
|
@ -189,7 +189,12 @@ class LayoutBuilderAccessTest extends BrowserTestBase {
|
||||||
$this->drupalGet('user/' . $non_editable_user->id() . '/layout');
|
$this->drupalGet('user/' . $non_editable_user->id() . '/layout');
|
||||||
$this->assertExpectedAccess($non_editable_access);
|
$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->drupalGet($non_viewable_user->toUrl());
|
||||||
$this->assertExpectedAccess(FALSE);
|
$this->assertExpectedAccess(FALSE);
|
||||||
$this->drupalGet($non_viewable_user->toUrl('edit-form'));
|
$this->drupalGet($non_viewable_user->toUrl('edit-form'));
|
||||||
|
|
|
@ -68,8 +68,14 @@ class LinkFieldUITest extends BrowserTestBase {
|
||||||
|
|
||||||
$this->firstContentType = $this->drupalCreateContentType();
|
$this->firstContentType = $this->drupalCreateContentType();
|
||||||
$this->secondContentType = $this->drupalCreateContentType();
|
$this->secondContentType = $this->drupalCreateContentType();
|
||||||
$this->adminUser = $this->drupalCreateUser(['administer content types', 'administer node fields', 'administer node display']);
|
$this->adminUser = $this->drupalCreateUser([
|
||||||
$this->helpTextUser = $this->drupalCreateUser(['create ' . $this->secondContentType->id() . ' content']);
|
'administer content types',
|
||||||
|
'administer node fields',
|
||||||
|
'administer node display',
|
||||||
|
]);
|
||||||
|
$this->helpTextUser = $this->drupalCreateUser([
|
||||||
|
'create ' . $this->secondContentType->id() . ' content',
|
||||||
|
]);
|
||||||
$this->drupalPlaceBlock('system_breadcrumb_block');
|
$this->drupalPlaceBlock('system_breadcrumb_block');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,13 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
|
||||||
* Test update changes configuration translations if enabled after language.
|
* Test update changes configuration translations if enabled after language.
|
||||||
*/
|
*/
|
||||||
public function testConfigTranslationImport() {
|
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);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Add a language. The Afrikaans translation file of locale_test_translate
|
// Add a language. The Afrikaans translation file of locale_test_translate
|
||||||
|
@ -90,7 +96,14 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
|
||||||
// import. Test that this override is in place.
|
// 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.');
|
$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);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Enable import of translations. By default this is disabled for automated
|
// Enable import of translations. By default this is disabled for automated
|
||||||
|
@ -149,7 +162,14 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
|
||||||
$this->container->get('module_installer')->install(['locale']);
|
$this->container->get('module_installer')->install(['locale']);
|
||||||
$this->resetAll();
|
$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);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Enable import of translations. By default this is disabled for automated
|
// Enable import of translations. By default this is disabled for automated
|
||||||
|
@ -187,7 +207,14 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
|
||||||
$this->container->get('module_installer')->install(['locale']);
|
$this->container->get('module_installer')->install(['locale']);
|
||||||
$this->resetAll();
|
$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);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Enable import of translations. By default this is disabled for automated
|
// Enable import of translations. By default this is disabled for automated
|
||||||
|
|
|
@ -48,7 +48,15 @@ class LocaleConfigTranslationTest extends BrowserTestBase {
|
||||||
|
|
||||||
// Add custom language.
|
// Add custom language.
|
||||||
$this->langcode = 'xx';
|
$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);
|
$this->drupalLogin($admin_user);
|
||||||
$name = $this->randomMachineName(16);
|
$name = $this->randomMachineName(16);
|
||||||
$edit = [
|
$edit = [
|
||||||
|
|
|
@ -31,7 +31,12 @@ class LocaleContentTest extends BrowserTestBase {
|
||||||
*/
|
*/
|
||||||
public function testMachineNameLTR() {
|
public function testMachineNameLTR() {
|
||||||
// User to add and remove language.
|
// 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.
|
// Log in as admin.
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
|
@ -63,9 +68,17 @@ class LocaleContentTest extends BrowserTestBase {
|
||||||
$type2 = $this->drupalCreateContentType();
|
$type2 = $this->drupalCreateContentType();
|
||||||
|
|
||||||
// User to add and remove language.
|
// 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.
|
// 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.
|
// Add custom language.
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
|
@ -140,9 +153,16 @@ class LocaleContentTest extends BrowserTestBase {
|
||||||
$type = $this->drupalCreateContentType();
|
$type = $this->drupalCreateContentType();
|
||||||
|
|
||||||
// User to add and remove language.
|
// 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.
|
// 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.
|
// Log in as admin.
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
|
@ -35,7 +35,11 @@ class LocaleExportTest extends BrowserTestBase {
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
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);
|
$this->drupalLogin($this->adminUser);
|
||||||
|
|
||||||
// Copy test po files to the translations directory.
|
// Copy test po files to the translations directory.
|
||||||
|
|
|
@ -55,8 +55,17 @@ class LocaleImportFunctionalTest extends BrowserTestBase {
|
||||||
$file_system->copy(__DIR__ . '/../../../tests/test.de.po', 'translations://', FileSystemInterface::EXISTS_REPLACE);
|
$file_system->copy(__DIR__ . '/../../../tests/test.de.po', 'translations://', FileSystemInterface::EXISTS_REPLACE);
|
||||||
$file_system->copy(__DIR__ . '/../../../tests/test.xx.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->adminUser = $this->drupalCreateUser([
|
||||||
$this->adminUserAccessSiteReports = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages', 'access site reports']);
|
'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);
|
$this->drupalLogin($this->adminUser);
|
||||||
|
|
||||||
// Enable import of translations. By default this is disabled for automated
|
// Enable import of translations. By default this is disabled for automated
|
||||||
|
|
|
@ -116,7 +116,11 @@ class LocaleJavascriptTranslationTest extends BrowserTestBase {
|
||||||
*/
|
*/
|
||||||
public function testLocaleTranslationJsDependencies() {
|
public function testLocaleTranslationJsDependencies() {
|
||||||
// User to add and remove language.
|
// 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.
|
// Add custom language.
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
|
@ -44,7 +44,14 @@ class LocalePathTest extends BrowserTestBase {
|
||||||
*/
|
*/
|
||||||
public function testPathLanguageConfiguration() {
|
public function testPathLanguageConfiguration() {
|
||||||
// User to add and remove language.
|
// 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.
|
// Add custom language.
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
|
@ -39,7 +39,11 @@ class LocalePluralFormatTest extends BrowserTestBase {
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
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);
|
$this->drupalLogin($this->adminUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue