function EntityKernelTestBaseTest::testSetUpCurrentUser
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBaseTest.php \Drupal\KernelTests\Core\Entity\EntityKernelTestBaseTest::testSetUpCurrentUser()
- 8.9.x core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBaseTest.php \Drupal\KernelTests\Core\Entity\EntityKernelTestBaseTest::testSetUpCurrentUser()
- 11.x 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 25
Class
Namespace
Drupal\KernelTests\Core\EntityCode
public function testSetUpCurrentUser() : void {
$account = $this->setUpCurrentUser();
$current_user = \Drupal::currentUser();
$this->assertSame($account->id(), $current_user->id());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.