function SchemaTest::testSchemaTableColumnSizeTooLargeException
Tests SchemaTableColumnSizeTooLargeException.
File
- 
              core/modules/ mysql/ tests/ src/ Kernel/ mysql/ SchemaTest.php, line 302 
Class
- SchemaTest
- Tests schema API for the MySQL driver.
Namespace
Drupal\Tests\mysql\Kernel\mysqlCode
public function testSchemaTableColumnSizeTooLargeException() : void {
  $this->expectException(SchemaTableColumnSizeTooLargeException::class);
  $this->expectExceptionMessage("Column length too big for column 'too_large' (max = 16383); use BLOB or TEXT instead");
  $this->schema
    ->createTable('test_schema', [
    'description' => 'Tests SchemaTableColumnSizeTooLargeException.',
    'fields' => [
      'too_large' => [
        'type' => 'varchar',
        'length' => 65536,
        'not null' => TRUE,
      ],
    ],
  ]);
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
