本文整理汇总了PHP中Zend\Db\Adapter\Adapter::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP Adapter::expects方法的具体用法?PHP Adapter::expects怎么用?PHP Adapter::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Db\Adapter\Adapter
的用法示例。
在下文中一共展示了Adapter::expects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUpMockedAdapter
/**
*
*/
public function setUpMockedAdapter()
{
$this->mockedDbAdapterDriver = $this->getMock('Zend\\Db\\Adapter\\Driver\\DriverInterface');
$this->mockedDbAdapterPlatform = $this->getMock('\\Zend\\Db\\Adapter\\Platform\\PlatformInterface', array());
$this->mockedDbAdapterStatement = $this->getMock('\\Zend\\Db\\Adapter\\Driver\\StatementInterface', array());
$this->mockedDbAdapterPlatform->expects($this->any())->method('getName')->will($this->returnValue('null'));
$this->mockedDbAdapter = $this->getMockBuilder('\\Zend\\Db\\Adapter\\Adapter')->setConstructorArgs(array($this->mockedDbAdapterDriver, $this->mockedDbAdapterPlatform))->getMock(array('getPlatform'));
$this->mockedDbAdapter->expects($this->any())->method('getPlatform')->will($this->returnValue($this->mockedDbAdapterPlatform));
$this->mockedDbSql = $this->getMockBuilder('\\Zend\\Db\\Sql\\Sql')->setConstructorArgs(array($this->mockedDbAdapter))->setMethods(array('prepareStatementForSqlObject'))->getMock();
$this->mockedDbSql->expects($this->any())->method('prepareStatementForSqlObject')->will($this->returnValue($this->mockedDbAdapterStatement));
$this->mockedDbSqlPlatform = $this->getMockBuilder('\\Zend\\Db\\Sql\\Platform\\Platform')->setConstructorArgs(array($this->mockedDbAdapter))->getMock();
}