示例#1
0
 public function testGetClassFromAlias()
 {
     $alias = 'Varien_Object_Alias';
     $diInstance = $this->getMock('Magento_Di_Zend', array('instanceManager'));
     $instanceManager = $this->getMock('Magento_Di_InstanceManager_Zend', array('addSharedInstance', 'removeSharedInstance', 'getClassFromAlias'), array(), '', false);
     $diInstance->expects($this->any())->method('instanceManager')->will($this->returnValue($instanceManager));
     $instanceManager->expects($this->any())->method('addSharedInstance')->will($this->returnSelf());
     $this->_objectManager = new Magento_ObjectManager_Zend(null, $diInstance);
     $instanceManager->expects($this->once())->method('getClassFromAlias')->with($alias);
     $this->_objectManager->getClassFromAlias($alias);
 }