You are here

protected function ViewsCacheInvalidationTest::setCurrentUser in Search API 8

Sets the user with the given key as the currently active user.

Parameters

string $user_key: The key of the user to set as currently active user.

Overrides UserCreationTrait::setCurrentUser

2 calls to ViewsCacheInvalidationTest::setCurrentUser()
ViewsCacheInvalidationTest::assertViewsResult in tests/src/Kernel/Views/ViewsCacheInvalidationTest.php
Checks that the view for the given user contains the expected results.
ViewsCacheInvalidationTest::doAssertCached in tests/src/Kernel/Views/ViewsCacheInvalidationTest.php
Checks the cache status of the view for the given user.

File

tests/src/Kernel/Views/ViewsCacheInvalidationTest.php, line 418

Class

ViewsCacheInvalidationTest
Tests that cached Search API views get invalidated at the right occasions.

Namespace

Drupal\Tests\search_api\Kernel\Views

Code

protected function setCurrentUser($user_key) {
  $this->currentUser
    ->setAccount($this->users[$user_key]);
}