Loading core/modules/comment/tests/src/Kernel/CommentDefaultFormatterCacheTagsTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ protected function setUp(): void { // Create user 1 so that the user created later in the test has a different // user ID. // @todo Remove in https://www.drupal.org/node/540008. $this->createUser(['uid' => 1, 'name' => 'user1'])->save(); $this->createUser([], NULL, FALSE, ['uid' => 1, 'name' => 'user1'])->save(); $this->container->get('module_handler')->loadInclude('comment', 'install'); comment_install(); Loading @@ -56,7 +56,7 @@ protected function setUp(): void { // user does not have access to the 'administer comments' permission, to // ensure only published comments are visible to the end user. $current_user = $this->container->get('current_user'); $current_user->setAccount($this->createUser([], ['access comments', 'post comments'])); $current_user->setAccount($this->createUser(['access comments', 'post comments'])); // Install tables and config needed to render comments. $this->installSchema('comment', ['comment_entity_statistics']); Loading core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php +8 −7 Original line number Diff line number Diff line Loading @@ -109,26 +109,27 @@ public function testAccessToAdministrativeFields() { // An administrator user. No user exists yet, ensure that the first user // does not have UID 1. $comment_admin_user = $this->createUser(['uid' => 2, 'name' => 'admin'], [ $comment_admin_user = $this->createUser([ 'administer comments', 'access comments', ]); ], 'admin', FALSE, ['uid' => 2]); // Two comment enabled users, one with edit access. $comment_enabled_user = $this->createUser(['name' => 'enabled'], [ $comment_enabled_user = $this->createUser([ 'post comments', 'skip comment approval', 'edit own comments', 'access comments', ]); $comment_no_edit_user = $this->createUser(['name' => 'no edit'], [ ], 'enabled'); $comment_no_edit_user = $this->createUser([ 'post comments', 'skip comment approval', 'access comments', ]); ], 'no edit'); // An unprivileged user. $comment_disabled_user = $this->createUser(['name' => 'disabled'], ['access content']); $comment_disabled_user = $this->createUser(['access content'], 'disabled'); $role = Role::load(RoleInterface::ANONYMOUS_ID); $role->grantPermission('post comments') Loading core/modules/contact/tests/src/Kernel/MessageEntityTest.php +3 −3 Original line number Diff line number Diff line Loading @@ -61,9 +61,9 @@ public function testMessageMethods() { $this->assertEquals('sender_mail', $message->getSenderMail()); $this->assertTrue($message->copySender()); $no_access_user = $this->createUser(['uid' => 2]); $access_user = $this->createUser(['uid' => 3], ['access site-wide contact form']); $admin = $this->createUser(['uid' => 4], ['administer contact forms']); $no_access_user = $this->createUser([], NULL, FALSE, ['uid' => 2]); $access_user = $this->createUser(['access site-wide contact form'], NULL, FALSE, ['uid' => 3]); $admin = $this->createUser(['administer contact forms'], NULL, FALSE, ['uid' => 4]); $this->assertFalse(\Drupal::entityTypeManager()->getAccessControlHandler('contact_message')->createAccess(NULL, $no_access_user)); $this->assertTrue(\Drupal::entityTypeManager()->getAccessControlHandler('contact_message')->createAccess(NULL, $access_user)); Loading core/modules/filter/tests/src/Kernel/FilterAPITest.php +6 −3 Original line number Diff line number Diff line Loading @@ -329,9 +329,12 @@ public function testTypedDataAPI() { $this->assertInstanceOf(OptionsProviderInterface::class, $data); $filtered_html_user = $this->createUser(['uid' => 2], [ FilterFormat::load('filtered_html')->getPermissionName(), ]); $filtered_html_user = $this->createUser( [FilterFormat::load('filtered_html')->getPermissionName()], NULL, FALSE, ['uid' => 2] ); // Test with anonymous user. $user = new AnonymousUserSession(); Loading core/modules/layout_builder/tests/src/Kernel/LayoutBuilderCompatibilityTestBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ protected function setUp(): void { $this->installConfig(['filter']); // Set up a non-admin user that is allowed to view test entities. \Drupal::currentUser()->setAccount($this->createUser(['uid' => 2], ['view test entity'])); \Drupal::currentUser()->setAccount($this->createUser(['view test entity'], NULL, FALSE, ['uid' => 2])); \Drupal::service('theme_installer')->install(['starterkit_theme']); $this->config('system.theme')->set('default', 'starterkit_theme')->save(); Loading Loading
core/modules/comment/tests/src/Kernel/CommentDefaultFormatterCacheTagsTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ protected function setUp(): void { // Create user 1 so that the user created later in the test has a different // user ID. // @todo Remove in https://www.drupal.org/node/540008. $this->createUser(['uid' => 1, 'name' => 'user1'])->save(); $this->createUser([], NULL, FALSE, ['uid' => 1, 'name' => 'user1'])->save(); $this->container->get('module_handler')->loadInclude('comment', 'install'); comment_install(); Loading @@ -56,7 +56,7 @@ protected function setUp(): void { // user does not have access to the 'administer comments' permission, to // ensure only published comments are visible to the end user. $current_user = $this->container->get('current_user'); $current_user->setAccount($this->createUser([], ['access comments', 'post comments'])); $current_user->setAccount($this->createUser(['access comments', 'post comments'])); // Install tables and config needed to render comments. $this->installSchema('comment', ['comment_entity_statistics']); Loading
core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php +8 −7 Original line number Diff line number Diff line Loading @@ -109,26 +109,27 @@ public function testAccessToAdministrativeFields() { // An administrator user. No user exists yet, ensure that the first user // does not have UID 1. $comment_admin_user = $this->createUser(['uid' => 2, 'name' => 'admin'], [ $comment_admin_user = $this->createUser([ 'administer comments', 'access comments', ]); ], 'admin', FALSE, ['uid' => 2]); // Two comment enabled users, one with edit access. $comment_enabled_user = $this->createUser(['name' => 'enabled'], [ $comment_enabled_user = $this->createUser([ 'post comments', 'skip comment approval', 'edit own comments', 'access comments', ]); $comment_no_edit_user = $this->createUser(['name' => 'no edit'], [ ], 'enabled'); $comment_no_edit_user = $this->createUser([ 'post comments', 'skip comment approval', 'access comments', ]); ], 'no edit'); // An unprivileged user. $comment_disabled_user = $this->createUser(['name' => 'disabled'], ['access content']); $comment_disabled_user = $this->createUser(['access content'], 'disabled'); $role = Role::load(RoleInterface::ANONYMOUS_ID); $role->grantPermission('post comments') Loading
core/modules/contact/tests/src/Kernel/MessageEntityTest.php +3 −3 Original line number Diff line number Diff line Loading @@ -61,9 +61,9 @@ public function testMessageMethods() { $this->assertEquals('sender_mail', $message->getSenderMail()); $this->assertTrue($message->copySender()); $no_access_user = $this->createUser(['uid' => 2]); $access_user = $this->createUser(['uid' => 3], ['access site-wide contact form']); $admin = $this->createUser(['uid' => 4], ['administer contact forms']); $no_access_user = $this->createUser([], NULL, FALSE, ['uid' => 2]); $access_user = $this->createUser(['access site-wide contact form'], NULL, FALSE, ['uid' => 3]); $admin = $this->createUser(['administer contact forms'], NULL, FALSE, ['uid' => 4]); $this->assertFalse(\Drupal::entityTypeManager()->getAccessControlHandler('contact_message')->createAccess(NULL, $no_access_user)); $this->assertTrue(\Drupal::entityTypeManager()->getAccessControlHandler('contact_message')->createAccess(NULL, $access_user)); Loading
core/modules/filter/tests/src/Kernel/FilterAPITest.php +6 −3 Original line number Diff line number Diff line Loading @@ -329,9 +329,12 @@ public function testTypedDataAPI() { $this->assertInstanceOf(OptionsProviderInterface::class, $data); $filtered_html_user = $this->createUser(['uid' => 2], [ FilterFormat::load('filtered_html')->getPermissionName(), ]); $filtered_html_user = $this->createUser( [FilterFormat::load('filtered_html')->getPermissionName()], NULL, FALSE, ['uid' => 2] ); // Test with anonymous user. $user = new AnonymousUserSession(); Loading
core/modules/layout_builder/tests/src/Kernel/LayoutBuilderCompatibilityTestBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ protected function setUp(): void { $this->installConfig(['filter']); // Set up a non-admin user that is allowed to view test entities. \Drupal::currentUser()->setAccount($this->createUser(['uid' => 2], ['view test entity'])); \Drupal::currentUser()->setAccount($this->createUser(['view test entity'], NULL, FALSE, ['uid' => 2])); \Drupal::service('theme_installer')->install(['starterkit_theme']); $this->config('system.theme')->set('default', 'starterkit_theme')->save(); Loading