You are here

protected function GroupKernelTestBase::getCurrentUser in Group 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Kernel/GroupKernelTestBase.php \Drupal\Tests\group\Kernel\GroupKernelTestBase::getCurrentUser()

Gets the current user so you can run some checks against them.

Return value

\Drupal\Core\Session\AccountInterface The current user.

47 calls to GroupKernelTestBase::getCurrentUser()
EntityAccessComplexTest::testMemberDeleteAnyAccess in tests/src/Kernel/EntityAccessComplexTest.php
Tests the deleting of any grouped entities for members.
EntityAccessComplexTest::testMemberDeleteOwnAccess in tests/src/Kernel/EntityAccessComplexTest.php
Tests the deleting of own grouped entities for members.
EntityAccessComplexTest::testMemberGroupAccessWithoutPermission in tests/src/Kernel/EntityAccessComplexTest.php
Tests that grouped nodes are properly hidden.
EntityAccessComplexTest::testMemberGroupAccessWithPermission in tests/src/Kernel/EntityAccessComplexTest.php
Tests that grouped nodes are visible to members.
EntityAccessComplexTest::testMemberUpdateAnyAccess in tests/src/Kernel/EntityAccessComplexTest.php
Tests the updating of any grouped entities for members.

... See full list

File

tests/src/Kernel/GroupKernelTestBase.php, line 51

Class

GroupKernelTestBase
Defines an abstract test base for group kernel tests.

Namespace

Drupal\Tests\group\Kernel

Code

protected function getCurrentUser() {
  return $this->container
    ->get('current_user')
    ->getAccount();
}