本文整理汇总了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());
}