コード例 #1
0
ファイル: ConfigTest.php プロジェクト: nemphys/magento2
 public function testGetAclResourcesWithDisabledCache()
 {
     $aclResources = new DOMDocument();
     $aclResources->loadXML('<?xml version="1.0" encoding="utf-8"?><config><acl></acl></config>');
     $this->_configMock->expects($this->once())->method('getModelInstance')->with($this->equalTo('Magento_Acl_Config_Reader'))->will($this->returnValue($this->_readerMock));
     $this->_cacheMock->expects($this->exactly(4))->method('canUse')->with($this->equalTo('config'))->will($this->returnValue(false));
     $this->_cacheMock->expects($this->never())->method('load');
     $this->_cacheMock->expects($this->never())->method('save');
     $this->_readerMock->expects($this->exactly(2))->method('getAclResources')->will($this->returnValue($aclResources));
     $firstCall = $this->_model->getAclResources();
     $secondCall = $this->_model->getAclResources();
     $this->assertNotEmpty($firstCall);
     $this->assertNotEmpty($secondCall);
 }
コード例 #2
0
ファイル: Resource.php プロジェクト: nemphys/magento2
 /**
  * Populate ACL with resources from external storage
  *
  * @param Magento_Acl $acl
  */
 public function populateAcl(Magento_Acl $acl)
 {
     $this->_addResourceTree($acl, $this->_config->getAclResources(), null);
 }