You are here

private function PageContextTest::getUser in Acquia Lift Connector 8

Get User.

Parameters

string $username:

Return value

Drupal\user\UserInterface|\PHPUnit_Framework_MockObject_MockObject

1 call to PageContextTest::getUser()
PageContextTest::getNode in tests/src/Unit/Service/Context/PageContextTest.php
Get Node.

File

tests/src/Unit/Service/Context/PageContextTest.php, line 371
Contains \Drupal\Tests\acquia_lift\Service\Context\PageContextTest.

Class

PageContextTest
PageContextTest Test.

Namespace

Drupal\Tests\acquia_lift\Service\Context

Code

private function getUser($username = 'a_username') {
  $user = $this
    ->getMock('Drupal\\user\\UserInterface');
  $user
    ->expects($this
    ->once())
    ->method('getUsername')
    ->willReturn($username);
  return $user;
}