本文整理汇总了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();
}
示例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));
}
示例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();
}
示例4: testGetCommands
public function testGetCommands()
{
$this->serviceManager->expects($this->atLeastOnce())->method('create');
$this->commandList->getCommands();
}