public function testUnabstractedDatabaseDependentTypes()
{
- $this->_conn->delete('DELETE FROM users');
+ $this->_createTestUsersTable();
+ $this->_conn->delete('DELETE FROM users');
$this->_conn->addColumn('users', 'intelligence_quotient', 'tinyint');
$this->_conn->insert('INSERT INTO users (intelligence_quotient) VALUES (300)');
} catch (Exception $e) {}
}
+ protected function _createTestUsersTable()
+ {
+ $table = $this->_conn->createTable('users');
+ $table->column('company_id', 'integer', array('limit' => 11));
+ $table->column('name', 'string', array('limit' => 255, 'default' => ''));
+ $table->column('first_name', 'string', array('limit' => 40, 'default' => ''));
+ $table->column('approved', 'boolean', array('default' => true));
+ $table->column('type', 'string', array('limit' => 255, 'default' => ''));
+ $table->column('created_at', 'datetime', array('default' => '0000-00-00 00:00:00'));
+ $table->column('created_on', 'date', array('default' => '0000-00-00'));
+ $table->column('updated_at', 'datetime', array('default' => '0000-00-00 00:00:00'));
+ $table->column('updated_on', 'date', array('default' => '0000-00-00'));
+ $table->end();
+ }
+
/**
* drop test tables
*/
$this->_conn->dropTable('unit_tests');
} catch (Exception $e) {}
try {
+ $this->_conn->dropTable('users');
+ } catch (Exception $e) {}
+ try {
$this->_conn->dropTable('sports');
} catch (Exception $e) {}
try {
} catch (Exception $e) {}
}
+ protected function _createTestUsersTable()
+ {
+ $table = $this->_conn->createTable('users');
+ $table->column('company_id', 'integer', array('limit' => 11));
+ $table->column('name', 'string', array('limit' => 255, 'default' => ''));
+ $table->column('first_name', 'string', array('limit' => 40, 'default' => ''));
+ $table->column('approved', 'boolean', array('default' => true));
+ $table->column('type', 'string', array('limit' => 255, 'default' => ''));
+ $table->column('created_at', 'datetime', array('default' => '0000-00-00 00:00:00'));
+ $table->column('created_on', 'date', array('default' => '0000-00-00'));
+ $table->column('updated_at', 'datetime', array('default' => '0000-00-00 00:00:00'));
+ $table->column('updated_on', 'date', array('default' => '0000-00-00'));
+ $table->end();
+ }
+
/**
* drop test tables
*/
$this->_conn->dropTable('unit_tests');
} catch (Exception $e) {}
try {
+ $this->_conn->dropTable('users');
+ } catch (Exception $e) {}
+ try {
$this->_conn->dropTable('sports');
} catch (Exception $e) {}
try {
} catch (Exception $e) {}
}
+ protected function _createTestUsersTable()
+ {
+ $table = $this->_conn->createTable('users');
+ $table->column('company_id', 'integer', array('limit' => 11));
+ $table->column('name', 'string', array('limit' => 255, 'default' => ''));
+ $table->column('first_name', 'string', array('limit' => 40, 'default' => ''));
+ $table->column('approved', 'boolean', array('default' => true));
+ $table->column('type', 'string', array('limit' => 255, 'default' => ''));
+ $table->column('created_at', 'datetime', array('default' => '0000-00-00 00:00:00'));
+ $table->column('created_on', 'date', array('default' => '0000-00-00'));
+ $table->column('updated_at', 'datetime', array('default' => '0000-00-00 00:00:00'));
+ $table->column('updated_on', 'date', array('default' => '0000-00-00'));
+ $table->end();
+ }
+
/**
* Get a column by name
*/