本文整理汇总了PHP中Zend\Db\Sql\Select::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP Select::expects方法的具体用法?PHP Select::expects怎么用?PHP Select::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Db\Sql\Select
的用法示例。
在下文中一共展示了Select::expects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
*
* @param arra $eventListenerArray
* @return array
*/
public function &setUpMockedMapper($eventListenerArray, array $mapperMethods = array())
{
$returnMockedParams = array();
$mapperMethods = count($mapperMethods) ? array_merge($mapperMethods, array('getSelect', 'select')) : array('getSelect', 'select');
$this->setUpMockMapperInsert($mapperMethods);
$this->mapper->expects($this->once())->method('select')->will($this->returnValue($this->mockedResultSet));
$mockedSelect = $this->mockedSelect;
$this->mockedSelect->expects($this->once())->method('where')->will($this->returnCallback(function () use(&$returnMockedParams, $mockedSelect) {
$returnMockedParams['whereArgs'] = func_get_args();
return $mockedSelect;
}));
foreach ($eventListenerArray as $eventKey => $eventListener) {
$this->mapper->getEventManager()->attach($eventKey, $eventListener);
}
$this->mapper->setDbAdapter($this->mockedDbAdapter);
$this->mapper->setEntityPrototype(new Entity());
return $returnMockedParams;
}
示例2: testFetchColWithEmptyTable
public function testFetchColWithEmptyTable()
{
$this->_select->expects($this->once())->method('columns')->with(array('col'), false);
$this->_table->method('selectWith')->with($this->_select)->willReturn(array());
$this->assertSame(array(), $this->_table->fetchCol('col'));
}