本文整理匯總了PHP中Zend_Test_DbStatement::createSelectStatement方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Test_DbStatement::createSelectStatement方法的具體用法?PHP Zend_Test_DbStatement::createSelectStatement怎麽用?PHP Zend_Test_DbStatement::createSelectStatement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Test_DbStatement
的用法示例。
在下文中一共展示了Zend_Test_DbStatement::createSelectStatement方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testCreateSelectStatementWithRows
public function testCreateSelectStatementWithRows()
{
$rows = array("foo", "bar");
$stmt = Zend_Test_DbStatement::createSelectStatement($rows);
$this->assertTrue($stmt instanceof Zend_Test_DbStatement);
$this->assertEquals($rows, $stmt->fetchAll());
}
示例2: testIsInstalled
public function testIsInstalled()
{
$installer = new Installer_Default($this->db);
$this->assertFalse($installer->isInstalled());
$this->dbAdapter->appendStatementToStack(Zend_Test_DbStatement::createSelectStatement(array('omeka_options')));
$this->assertTrue($installer->isInstalled());
$this->profilerHelper->assertDbQuery("SHOW TABLES LIKE 'omeka_options'");
}
示例3: testAppendStatementToStack
public function testAppendStatementToStack()
{
$stmt1 = Zend_Test_DbStatement::createSelectStatement(array());
$this->_adapter->appendStatementToStack($stmt1);
$stmt2 = Zend_Test_DbStatement::createSelectStatement(array());
$this->_adapter->appendStatementToStack($stmt2);
$this->assertSame($stmt2, $this->_adapter->query("foo"));
$this->assertSame($stmt1, $this->_adapter->query("foo"));
}
示例4: testSetRecordUsingIntegerId
public function testSetRecordUsingIntegerId()
{
$builder = new DummyRecordBuilder($this->db);
$this->dbAdapter->appendStatementToStack(Zend_Test_DbStatement::createSelectStatement(array(array('id' => self::DUMMY_RECORD_ID, 'description' => 'foobar'))));
$builder->setRecord(self::DUMMY_RECORD_ID);
$record = $builder->getRecord();
$this->assertThat($record, $this->isInstanceOf('DummyRecordBuilderRecord'));
$this->assertTrue($record->exists());
}
示例5: testTotalItems
public function testTotalItems()
{
$collectionId = 1;
$this->dbAdapter = new Zend_Test_DbAdapter();
$this->dbAdapter->appendLastInsertIdToStack($collectionId);
$this->db = new Omeka_Db($this->dbAdapter);
$this->collection = new Collection($this->db);
$this->profilerHelper = new Omeka_Test_Helper_DbProfiler($this->db->getAdapter()->getProfiler(), $this);
$this->dbAdapter->appendStatementToStack(Zend_Test_DbStatement::createSelectStatement(array(array(3))));
$this->assertEquals(3, $this->collection->totalItems());
}