public function testTableExceptionInvalidPrimaryKey() { try { $table = new \ZendTest\Db\Table\TestAsset\TableBugs(array('primary' => 'foo')); $primary = $table->info(Table\AbstractTable::PRIMARY); $this->fail('Expected to catch Zend_Db_Table_Exception'); } catch (\Zend\Exception $e) { $this->assertType('Zend\\Db\\Table\\Exception', $e, '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()); } }
/** * 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 \ZendTest\Db\Table\TestAsset\TableBugs($config); $rowset = $table->fetchAll(); $this->assertThat($rowset, $this->isInstanceOf('Zend_Db_Table_Rowset')); $this->assertEquals(4, count($rowset)); }