33 $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
35 $this->adminSession = $this->getMockBuilder(\
Magento\Backend\Model\Auth\Session::class)
36 ->disableOriginalConstructor()
37 ->setMethods([
'hasUser',
'getUser',
'getId'])
40 $this->adminSessionUserContext = $this->objectManager->getObject(
41 \
Magento\
User\Model\Authorization\AdminSessionUserContext::class,
42 [
'adminSession' => $this->adminSession]
52 $this->assertEquals($userId, $this->adminSessionUserContext->getUserId());
61 $this->assertEquals($userId, $this->adminSessionUserContext->getUserId());
75 $this->adminSession->expects($this->once())
77 ->will($this->returnValue($userId));
80 $this->adminSession->expects($this->once())
82 ->will($this->returnSelf());
84 $this->adminSession->expects($this->once())
86 ->will($this->returnValue($userId));
testGetUserIdDoesNotExist()