Loading core/modules/node/tests/src/Kernel/NodeAccessTestBase.php +4 −3 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\Tests\node\Kernel; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Session\AccountInterface; use Drupal\KernelTests\KernelTestBase; use Drupal\node\NodeInterface; Loading Loading @@ -109,13 +110,13 @@ public function assertNodeAccess(array $ops, NodeInterface $node, AccountInterfa * Whether access should be granted or not. * @param \Drupal\Core\Session\AccountInterface $account * The user account for which to check access. * @param string|null $langcode * @param string $langcode * (optional) The language code indicating which translation of the node * to check. If NULL, the untranslated (fallback) access is checked. * to check. If omitted, the untranslated (fallback) access is checked. * * @internal */ public function assertNodeCreateAccess(string $bundle, bool $result, AccountInterface $account, ?string $langcode = NULL) { public function assertNodeCreateAccess(string $bundle, bool $result, AccountInterface $account, string $langcode = LanguageInterface::LANGCODE_DEFAULT) { $this->assertEquals($result, $this->accessHandler->createAccess($bundle, $account, [ 'langcode' => $langcode, ]), $this->nodeAccessAssertMessage('create', $result, $langcode)); Loading core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php +4 −2 Original line number Diff line number Diff line Loading @@ -101,8 +101,10 @@ public function testPreExistingItemsValidation(): void { $role_without_access->grantPermission('access content'); $role_without_access->save(); $user_with_access = User::create(['roles' => ['role_with_access']]); $user_without_access = User::create(['roles' => ['role_without_access']]); $user_with_access = User::create(['name' => $this->randomString(), 'roles' => ['role_with_access']]); $user_with_access->save(); $user_without_access = User::create(['name' => $this->randomString(), 'roles' => ['role_without_access']]); $user_without_access->save(); // Add an entity reference field. $this->createEntityReferenceField( Loading Loading
core/modules/node/tests/src/Kernel/NodeAccessTestBase.php +4 −3 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\Tests\node\Kernel; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Session\AccountInterface; use Drupal\KernelTests\KernelTestBase; use Drupal\node\NodeInterface; Loading Loading @@ -109,13 +110,13 @@ public function assertNodeAccess(array $ops, NodeInterface $node, AccountInterfa * Whether access should be granted or not. * @param \Drupal\Core\Session\AccountInterface $account * The user account for which to check access. * @param string|null $langcode * @param string $langcode * (optional) The language code indicating which translation of the node * to check. If NULL, the untranslated (fallback) access is checked. * to check. If omitted, the untranslated (fallback) access is checked. * * @internal */ public function assertNodeCreateAccess(string $bundle, bool $result, AccountInterface $account, ?string $langcode = NULL) { public function assertNodeCreateAccess(string $bundle, bool $result, AccountInterface $account, string $langcode = LanguageInterface::LANGCODE_DEFAULT) { $this->assertEquals($result, $this->accessHandler->createAccess($bundle, $account, [ 'langcode' => $langcode, ]), $this->nodeAccessAssertMessage('create', $result, $langcode)); Loading
core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php +4 −2 Original line number Diff line number Diff line Loading @@ -101,8 +101,10 @@ public function testPreExistingItemsValidation(): void { $role_without_access->grantPermission('access content'); $role_without_access->save(); $user_with_access = User::create(['roles' => ['role_with_access']]); $user_without_access = User::create(['roles' => ['role_without_access']]); $user_with_access = User::create(['name' => $this->randomString(), 'roles' => ['role_with_access']]); $user_with_access->save(); $user_without_access = User::create(['name' => $this->randomString(), 'roles' => ['role_without_access']]); $user_without_access->save(); // Add an entity reference field. $this->createEntityReferenceField( Loading