// Assert that the column comment has been set.
$this->
checkSchemaComment($table_specification['fields'
]['test_field'
]['description'
], 'test_table', 'test_field'
);
// Make sure that fields have the correct collation, if supported.
$this->
assertCollation();
// An insert without a value for the column 'test_table' should fail.
$this->
assertFalse($this->
tryInsert(), 'Insert without a default failed.'
);
// Add a default value to the column.
$this->schema->
changeField('test_table', 'test_field', 'test_field',
['type' => 'int', 'not null' => TRUE, 'default' => 0
]);
// The insert should now succeed.
$this->
assertTrue($this->
tryInsert(), 'Insert with a default succeeded.'
);
// Remove the default.
$this->schema->
changeField('test_table', 'test_field', 'test_field',
['type' => 'int', 'not null' => TRUE
]);
// The insert should fail again.
$this->
assertFalse($this->
tryInsert(), 'Insert without a default failed.'
);
// Test for fake index and test for the boolean result of indexExists().
$index_exists =
$this->schema->
indexExists('test_table', 'test_field'
);
$this->
assertFalse($index_exists, 'Fake index does not exist'
);