本文整理匯總了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);
}