You are here

public function SchemaTest::testChangeFieldComment in Drupal driver for SQL Server and SQL Azure 8.2

Same name and namespace in other branches
  1. 4.2.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::testChangeFieldComment()
  2. 3.0.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::testChangeFieldComment()
  3. 3.1.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::testChangeFieldComment()
  4. 4.0.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::testChangeFieldComment()
  5. 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 120

Class

SchemaTest
Tests table creation and modification via the schema API.

Namespace

Drupal\Tests\sqlsrv\Kernel

Code

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);
}