function SchemaDefinitionTest::testMissingVarcharColumnLength
Tests passing varchar columns without length.
File
-
core/
tests/ Drupal/ Tests/ Core/ Database/ SchemaDefinitionTest.php, line 657
Class
- SchemaDefinitionTest
- Tests SchemaDefinition Column object validations.
Namespace
Drupal\Tests\Core\DatabaseCode
public function testMissingVarcharColumnLength() : void {
$this->expectException(SchemaDefinitionException::class);
$this->expectExceptionMessageIs('Missing \'length\' for varchar column \'id\'');
new Table(name: 'test', columns: [
Column::varchar(name: 'id', default: new StringValue('foo')),
], primaryKey: new PrimaryKey([
'id',
]));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.