当前位置: 首页>>代码示例>>PHP>>正文


PHP ServiceManager::expects方法代码示例

本文整理汇总了PHP中Zend\ServiceManager\ServiceManager::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP ServiceManager::expects方法的具体用法?PHP ServiceManager::expects怎么用?PHP ServiceManager::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\ServiceManager\ServiceManager的用法示例。


在下文中一共展示了ServiceManager::expects方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetCommands

 public function testGetCommands()
 {
     $commands = ['Magento\\Setup\\Console\\Command\\AdminUserCreateCommand', 'Magento\\Setup\\Console\\Command\\ConfigSetCommand', 'Magento\\Setup\\Console\\Command\\DbDataUpgradeCommand', 'Magento\\Setup\\Console\\Command\\DbSchemaUpgradeCommand', 'Magento\\Setup\\Console\\Command\\DbStatusCommand', 'Magento\\Setup\\Console\\Command\\InfoCurrencyListCommand', 'Magento\\Setup\\Console\\Command\\InfoLanguageListCommand', 'Magento\\Setup\\Console\\Command\\InfoTimezoneListCommand', 'Magento\\Setup\\Console\\Command\\InstallCommand', 'Magento\\Setup\\Console\\Command\\InstallStoreConfigurationCommand', 'Magento\\Setup\\Console\\Command\\ModuleEnableCommand', 'Magento\\Setup\\Console\\Command\\ModuleDisableCommand', 'Magento\\Setup\\Console\\Command\\ModuleStatusCommand', 'Magento\\Setup\\Console\\Command\\MaintenanceAllowIpsCommand', 'Magento\\Setup\\Console\\Command\\MaintenanceDisableCommand', 'Magento\\Setup\\Console\\Command\\MaintenanceEnableCommand', 'Magento\\Setup\\Console\\Command\\MaintenanceStatusCommand', 'Magento\\Setup\\Console\\Command\\UpgradeCommand', 'Magento\\Setup\\Console\\Command\\UninstallCommand'];
     $index = 0;
     foreach ($commands as $command) {
         $this->serviceManager->expects($this->at($index++))->method('create')->with($command);
     }
     $this->commandList->getCommands();
 }
开发者ID:opexsw,项目名称:magento2,代码行数:9,代码来源:CommandListTest.php

示例2: setUp

 public function setUp()
 {
     $this->application = $this->getMock('Zend\\Mvc\\Application', array(), array(), '', false);
     $this->event = $this->getMock('Zend\\Mvc\\MvcEvent');
     $this->serviceManager = $this->getMock('Zend\\ServiceManager\\ServiceManager');
     $this->cli = $this->getMock('Symfony\\Component\\Console\\Application', array('run'));
     $this->serviceManager->expects($this->any())->method('get')->with('doctrine.cli')->will($this->returnValue($this->cli));
     $this->application->expects($this->any())->method('getServiceManager')->will($this->returnValue($this->serviceManager));
     $this->event->expects($this->any())->method('getTarget')->will($this->returnValue($this->application));
 }
开发者ID:shitikovkirill,项目名称:zend-shop.com,代码行数:10,代码来源:ModuleTest.php

示例3: testUnloginAction

 /**
  * @covers \Magento\Setup\Controller\Session::testUnloginAction
  */
 public function testUnloginAction()
 {
     $this->objectManagerProvider->expects($this->once())->method('get')->will($this->returnValue($this->objectManager));
     $deployConfigMock = $this->getMock('Magento\\Framework\\App\\DeploymentConfig', ['isAvailable'], [], '', false);
     $deployConfigMock->expects($this->once())->method('isAvailable')->will($this->returnValue(true));
     $stateMock = $this->getMock('Magento\\Framework\\App\\State', ['setAreaCode'], [], '', false);
     $stateMock->expects($this->once())->method('setAreaCode');
     $sessionConfigMock = $this->getMock('Magento\\Backend\\Model\\Session\\AdminConfig', ['setCookiePath'], [], '', false);
     $sessionConfigMock->expects($this->once())->method('setCookiePath');
     $returnValueMap = [['Magento\\Framework\\App\\State', $stateMock], ['Magento\\Backend\\Model\\Session\\AdminConfig', $sessionConfigMock]];
     $this->serviceManager->expects($this->once())->method('get')->will($this->returnValue($deployConfigMock));
     $this->objectManager->expects($this->atLeastOnce())->method('get')->will($this->returnValueMap($returnValueMap));
     $sessionMock = $this->getMock('Magento\\Backend\\Model\\Auth\\Session', ['prolong'], [], '', false);
     $this->objectManager->expects($this->once())->method('create')->will($this->returnValue($sessionMock));
     $controller = new Session($this->serviceManager, $this->objectManagerProvider);
     $controller->prolongAction();
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:20,代码来源:SessionTest.php

示例4: testGetCommands

 public function testGetCommands()
 {
     $this->serviceManager->expects($this->atLeastOnce())->method('create');
     $this->commandList->getCommands();
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:5,代码来源:CommandListTest.php


注:本文中的Zend\ServiceManager\ServiceManager::expects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。