--- tests/Zend/Db/Table/TestCommon.php (revision 23864) +++ tests/Zend/Db/Table/TestCommon.php (working copy) @@ -1013,6 +1013,44 @@ $this->assertEquals('New bug', $row->bug_description); } + /** + * @group ZF-8944 + * @group ZF-10598 + * @group ZF-11253 + */ + public function testTableFetchRowOffset() + { + $reported_by = $this->_db->quoteIdentifier('reported_by', true); + + $table = $this->_table['bugs']; + $row = $table->fetchRow(array("$reported_by = ?" => 'goofy'), null, 1); + $this->assertType('Zend_Db_Table_Row_Abstract', $row, + 'Expecting object of type Zend_Db_Table_Row_Abstract, got '.get_class($row)); + $bug_id = $this->_db->foldCase('bug_id'); + $this->assertEquals(2, $row->$bug_id); + } + + /** + * @group ZF-8944 + * @group ZF-10598 + * @group ZF-11253 + */ + public function testTableFetchRowOffsetSelect() + { + $reported_by = $this->_db->quoteIdentifier('reported_by', true); + + $table = $this->_table['bugs']; + $select = $table->select() + ->where("$reported_by = ?", 'goofy') + ->limit(1, 1); + + $row = $table->fetchRow($select); + $this->assertType('Zend_Db_Table_Row_Abstract', $row, + 'Expecting object of type Zend_Db_Table_Row_Abstract, got '.get_class($row)); + $bug_id = $this->_db->foldCase('bug_id'); + $this->assertEquals(2, $row->$bug_id); + } + public function testTableFetchRow() { $table = $this->_table['bugs'];