_db->select() ->from('zfproducts'); $stmt = $this->_db->prepare($select->__toString()); $result = $stmt->nextRowset(); // there is no next rowset so $result should be false $this->assertFalse($result); $stmt->closeCursor(); } public function testStatementColumnCountForSelect() { $select = $this->_db->select() ->from('zfproducts'); $stmt = $this->_db->prepare($select->__toString()); $n = $stmt->columnCount(); $this->assertEquals(2, $n); $stmt->execute(); $n = $stmt->columnCount(); $stmt->closeCursor(); $this->assertType('integer', $n); $this->assertEquals(2, $n); } public function testStatementGetSetAttribute() { $select = $this->_db->select() ->from('zfproducts'); $stmt = $this->_db->prepare($select->__toString()); $value = 'value'; try { $stmt->setAttribute(1234, $value); } catch (Zend_Exception $e) { $this->assertContains('This driver doesn\'t support setting attributes', $e->getMessage()); } try { $this->assertEquals($value, $stmt->getAttribute(1234), "Expected '$value' #1"); } catch (Zend_Exception $e) { $this->assertContains('Driver does not support this function: 1 Unknown attribute', $e->getMessage()); return; } $valueArray = array('value1', 'value2'); $stmt->setAttribute(1235, $valueArray); $this->assertEquals($valueArray, $stmt->getAttribute(1235), "Expected array #1"); $this->assertEquals($value, $stmt->getAttribute(1234), "Expected '$value' #2"); $valueObject = new stdClass(); $stmt->setAttribute(1236, $valueObject); $this->assertSame($valueObject, $stmt->getAttribute(1236), "Expected object"); $this->assertEquals($valueArray, $stmt->getAttribute(1235), "Expected array #2"); $this->assertEquals($value, $stmt->getAttribute(1234), "Expected '$value' #2"); } }