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