public function SchemaTest::testChangeFieldComment in Drupal driver for SQL Server and SQL Azure 4.0.x
Same name and namespace in other branches
- 8.2 tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::testChangeFieldComment()
- 4.2.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::testChangeFieldComment()
- 3.0.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::testChangeFieldComment()
- 3.1.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::testChangeFieldComment()
- 4.1.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::testChangeFieldComment()
Verify that comments are changed when the field is altered.
File
- tests/
src/ Kernel/ SchemaTest.php, line 116
Class
- SchemaTest
- Tests table creation and modification via the schema API.
Namespace
Drupal\Tests\sqlsrv\KernelCode
public function testChangeFieldComment() {
// Add field with different description.
$spec = $this->table['fields']['name'];
$spec['description'] = 'New name comment';
$this->schema
->changeField('test', 'name', 'name', $spec);
// Verify comment is correct.
$comment = $this->schema
->getComment('test', 'name');
$this
->assertEquals('New name comment', $comment);
}