function SchemaDefinitionTest::testStringDefaultForTextColumn
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Database/SchemaDefinitionTest.php \Drupal\Tests\Core\Database\SchemaDefinitionTest::testStringDefaultForTextColumn()
Tests passing a string default to a text column.
File
-
core/
tests/ Drupal/ Tests/ Core/ Database/ SchemaDefinitionTest.php, line 370
Class
- SchemaDefinitionTest
- Tests SchemaDefinition Column object validations.
Namespace
Drupal\Tests\Core\DatabaseCode
public function testStringDefaultForTextColumn() : void {
$table = new Table(name: 'test', columns: [
Column::text(name: 'id', default: new StringValue('foo')),
], primaryKey: new PrimaryKey([
'id',
]));
$this->assertInstanceOf(Table::class, $table);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.