29 $roleLocatorMock = $this->createMock(\
Magento\Framework\
Authorization\RoleLocatorInterface::class);
30 $roleLocatorMock->expects($this->any())->method(
'getAclRoleId')->will($this->returnValue(
'U1'));
31 $this->_model = new \Magento\Framework\Authorization($this->_policyMock, $roleLocatorMock);
41 $this->_policyMock->expects($this->once())->method(
'isAllowed')->will($this->returnValue(
true));
42 $this->assertTrue($this->_model->isAllowed(
'Magento_Module::acl_resource'));
47 $this->_policyMock->expects($this->once())->method(
'isAllowed')->will($this->returnValue(
false));
48 $this->assertFalse($this->_model->isAllowed(
'Magento_Module::acl_resource'));
testIsAllowedReturnNegativeValue()
testIsAllowedReturnPositiveValue()