You are here

public function EntityKernelTestBaseTest::testSetUpCurrentUser in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBaseTest.php \Drupal\KernelTests\Core\Entity\EntityKernelTestBaseTest::testSetUpCurrentUser()
  2. 9 core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBaseTest.php \Drupal\KernelTests\Core\Entity\EntityKernelTestBaseTest::testSetUpCurrentUser()

Tests that the current user is set up correctly.

File

core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBaseTest.php, line 23

Class

EntityKernelTestBaseTest
@covers \Drupal\KernelTests\Core\Entity\EntityKernelTestBase

Namespace

Drupal\KernelTests\Core\Entity

Code

public function testSetUpCurrentUser() {
  $account = $this
    ->setUpCurrentUser();
  $current_user = \Drupal::currentUser();
  $this
    ->assertSame($account
    ->id(), $current_user
    ->id());
}