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