/** * Ensures that a schema given in the 'name' constructor configuration directive overrides any schema specified * by the 'schema' constructor configuration directive. * * @return void */ public function testTableSchemaConstructorConfigNameOverridesSchema() { $schema = 'public'; $tableName = "{$schema}.zfbugs"; $config = array('db' => $this->_db, 'schema' => 'foo', 'name' => $tableName); $table = new My_ZendDbTable_TableBugs($config); $tableInfo = $table->info(); $this->assertEquals($schema, $tableInfo['schema']); }
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()); } }