本文整理汇总了PHP中Zend_Test_DbStatement::append方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Test_DbStatement::append方法的具体用法?PHP Zend_Test_DbStatement::append怎么用?PHP Zend_Test_DbStatement::append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Test_DbStatement
的用法示例。
在下文中一共展示了Zend_Test_DbStatement::append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createSelectStatement
/**
* Create a Select statement which returns the given array of rows.
*
* @param array $rows
* @return Zend_Test_DbStatement
*/
public static function createSelectStatement(array $rows = array())
{
$stmt = new Zend_Test_DbStatement();
foreach ($rows as $row) {
$stmt->append($row);
}
return $stmt;
}
示例2: testDataIsLoadedOnlyOnce
public function testDataIsLoadedOnlyOnce()
{
$fixtureSql = "SELECT * FROM foo";
$statementMock = new Zend_Test_DbStatement();
$statementMock->append(array('foo' => 'bar'));
$adapterMock = $this->getMock('Zend_Test_DbAdapter');
$adapterMock->expects($this->once())->method('query')->with($fixtureSql)->will($this->returnValue($statementMock));
$this->decorateConnectionGetConnectionWith($adapterMock);
$queryTable = new Zend_Test_PHPUnit_Db_DataSet_QueryTable("foo", $fixtureSql, $this->connectionMock);
$this->assertEquals(1, $queryTable->getRowCount());
$this->assertEquals(1, $queryTable->getRowCount());
$row = $queryTable->getRow(0);
$this->assertEquals(array('foo' => 'bar'), $row);
}
示例3: testFetchObject_ClassNotExists_ThrowsException
public function testFetchObject_ClassNotExists_ThrowsException()
{
$this->setExpectedException("Zend_Db_Statement_Exception");
$row = array("foo" => "bar", "bar" => "baz");
$stmt = new Zend_Test_DbStatement();
$stmt->append($row);
$object = $stmt->fetchObject("anInvalidClassName");
}