$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'
);
// Add index.
$this->schema->
addIndex('test_table', 'test_field',
['test_field'
],
$table_specification);
// Test for created index and test for the boolean result of indexExists().
$index_exists =
$this->schema->
indexExists('test_table', 'test_field'
);
$this->
assertTrue($index_exists, 'Index created.'
);
// Rename the table.
$this->
assertNull($this->schema->
renameTable('test_table', 'test_table2'
));
// Index should be renamed.
$index_exists =
$this->schema->
indexExists('test_table2', 'test_field'
);
$this->
assertTrue($index_exists, 'Index was renamed.'
);