/** * Ensures that fetchAll() provides expected behavior when the schema is specified * * @return void */ public function testTableFetchAllSchemaSet() { $schema = 'public'; $config = array('db' => $this->_db, 'schema' => $schema); $table = new My_ZendDbTable_TableBugs($config); $rowset = $table->fetchAll(); $this->assertThat($rowset, $this->isInstanceOf('Zend_Db_Table_Rowset')); $this->assertEquals(4, count($rowset)); }
public function testTableExceptionInvalidPrimaryKey() { try { $table = new My_ZendDbTable_TableBugs(array('primary' => 'foo')); $primary = $table->info(Zend_Db_Table_Abstract::PRIMARY); $this->fail('Expected to catch Zend_Db_Table_Exception'); } catch (Zend_Exception $e) { $this->assertTrue($e instanceof Zend_Db_Table_Exception, 'Expecting object of type Zend_Db_Table_Exception, got ' . get_class($e)); $this->assertContains("Primary key column(s)", $e->getMessage()); $this->assertContains("are not columns in this table", $e->getMessage()); } }