only in patch2: unchanged: --- a/core/modules/system/src/Tests/Database/SchemaTest.php +++ b/core/modules/system/src/Tests/Database/SchemaTest.php @@ -10,6 +10,7 @@ use Drupal\Core\Database\Database; use Drupal\Core\Database\SchemaObjectDoesNotExistException; use Drupal\Core\Database\SchemaObjectExistsException; +use Drupal\Component\Utility\Unicode; use Drupal\simpletest\UnitTestBase; /** @@ -30,7 +31,7 @@ class SchemaTest extends UnitTestBase { function testSchema() { // Try creating a table. $table_specification = array( - 'description' => 'Schema table description.', + 'description' => 'Schema table description may contain "quotes" and could be long—very long indeed.', 'fields' => array( 'id' => array( 'type' => 'int', @@ -39,7 +40,7 @@ function testSchema() { 'test_field' => array( 'type' => 'int', 'not null' => TRUE, - 'description' => 'Schema column description.', + 'description' => 'Schema table description may contain "quotes" and could be long—very long indeed. There could be "multiple quoted regions".', ), 'test_field_string' => array( 'type' => 'varchar', @@ -212,6 +213,13 @@ function tryInsert($table = 'test_table') { function checkSchemaComment($description, $table, $column = NULL) { if (method_exists(Database::getConnection()->schema(), 'getComment')) { $comment = Database::getConnection()->schema()->getComment($table, $column); + $db_type = Database::getConnection()->databaseType(); + // The schema comment truncation for mysql is different. + if ($db_type == 'mysql') { + $max_length = $column ? 255 : 60; + $description = Unicode::truncate($description, $max_length, TRUE, TRUE); + $this->assertFalse(0, $description); + } $this->assertEqual($comment, $description, 'The comment matches the schema description.'); } }