function SchemaTest::checkSchemaComment

Checks that a table or column comment matches a given description.

Parameters

$description: The asserted description.

$table: The table to test.

$column: Optional column to test.

1 call to SchemaTest::checkSchemaComment()
SchemaTest::testSchema in drupal/core/modules/system/lib/Drupal/system/Tests/Common/SchemaTest.php
Tests database interactions.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Common/SchemaTest.php, line 179
Definition of Drupal\system\Tests\Common\SchemaTest.

Class

SchemaTest
Tests the Schema API.

Namespace

Drupal\system\Tests\Common

Code

function checkSchemaComment($description, $table, $column = NULL) {
  if (method_exists(Database::getConnection()
    ->schema(), 'getComment')) {
    $comment = Database::getConnection()
      ->schema()
      ->getComment($table, $column);
    $this
      ->assertEqual($comment, $description, 'The comment matches the schema description.');
  }
}