本文整理汇总了PHP中Varien_Db_Select::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Db_Select::expects方法的具体用法?PHP Varien_Db_Select::expects怎么用?PHP Varien_Db_Select::expects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Db_Select
的用法示例。
在下文中一共展示了Varien_Db_Select::expects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getModelDependencies
/**
* Retrieve all necessary objects mocks which used inside customer storage
*
* @param int $tableRowsCount
* @param array $tableData
* @param array $aliasesMap
*
* @return array
*/
protected function _getModelDependencies($tableRowsCount = 0, $tableData = array(), $aliasesMap = array())
{
$this->_selectMock = $this->getMock('Varien_Db_Select', array(), array(), '', false);
$this->_selectMock->expects($this->any())->method('from')->will($this->returnSelf());
$this->_selectMock->expects($this->any())->method('where')->will($this->returnCallback(array($this, 'whereCallback')));
$adapterMock = $this->getMock('Varien_Db_Adapter_Pdo_Mysql', array('select', 'update', 'fetchAll', 'fetchOne'), array(), '', false);
$adapterMock->expects($this->any())->method('select')->will($this->returnValue($this->_selectMock));
$adapterMock->expects($this->any())->method('update')->will($this->returnCallback(array($this, 'updateCallback')));
$adapterMock->expects($this->any())->method('fetchAll')->will($this->returnValue($tableData));
$adapterMock->expects($this->any())->method('fetchOne')->will($this->returnValue($tableRowsCount));
return array('resource_config' => 'not_used', 'connection_config' => 'not_used', 'module_config' => 'not_used', 'base_dir' => 'not_used', 'path_to_map_file' => 'not_used', 'connection' => $adapterMock, 'core_helper' => new Mage_Core_Helper_Data(), 'aliases_map' => $aliasesMap);
}