Skip to content

Commit

Permalink
MDL-19057 test_get_indexes() moved and fixed name
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 6, 2010
1 parent e0962d2 commit 5d1e1ad
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions lib/dml/simpletest/testdml.php
Expand Up @@ -365,28 +365,7 @@ public function test_get_tables() {
$this->assertTrue(count($DB->get_tables()) == $original_count);
}

public function testDefaults() {
$DB = $this->tdb;
$dbman = $this->tdb->get_manager();

$table = $this->get_test_table();
$tablename = $table->getName();

$table->add_field('enumfield', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, 'test2');
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
$dbman->create_table($table);
$this->tables[$tablename] = $table;

$columns = $DB->get_columns($tablename);

$enumfield = $columns['enumfield'];
$this->assertEqual('test2', $enumfield->default_value);
$this->assertEqual('C', $enumfield->meta_type);

}

public function testGetIndexes() {
public function test_get_indexes() {
$DB = $this->tdb;
$dbman = $this->tdb->get_manager();

Expand Down Expand Up @@ -422,6 +401,27 @@ public function testGetIndexes() {
$this->assertEqual('id', $composed['columns'][1]);
}

public function testDefaults() {
$DB = $this->tdb;
$dbman = $this->tdb->get_manager();

$table = $this->get_test_table();
$tablename = $table->getName();

$table->add_field('enumfield', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, 'test2');
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
$dbman->create_table($table);
$this->tables[$tablename] = $table;

$columns = $DB->get_columns($tablename);

$enumfield = $columns['enumfield'];
$this->assertEqual('test2', $enumfield->default_value);
$this->assertEqual('C', $enumfield->meta_type);

}

public function testGetColumns() {
$DB = $this->tdb;
$dbman = $this->tdb->get_manager();
Expand Down

0 comments on commit 5d1e1ad

Please sign in to comment.