示例#1
0
 public function testAddAlias()
 {
     $alias = 'Varien_Object_Alias';
     $diInstance = $this->getMock('Magento_Di_Zend', array('instanceManager'));
     $instanceManager = $this->getMock('Magento_Di_InstanceManager_Zend', array('addSharedInstance', 'removeSharedInstance', 'addAlias'), 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('addAlias')->with($alias, self::CLASS_NAME, array());
     $this->_objectManager->addAlias($alias, self::CLASS_NAME);
 }