protected function SchemaTest::setUp in Drupal driver for SQL Server and SQL Azure 4.1.x
Same name and namespace in other branches
- 8.2 tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::setUp()
- 4.2.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::setUp()
- 3.0.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::setUp()
- 3.1.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::setUp()
- 4.0.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::setUp()
Overrides DatabaseTestBase::setUp
File
- tests/
src/ Kernel/ SchemaTest.php, line 32
Class
- SchemaTest
- Tests table creation and modification via the schema API.
Namespace
Drupal\Tests\sqlsrv\KernelCode
protected function setUp() {
parent::setUp();
/** @var \Drupal\sqlsrv\Driver\Database\sqlsrv\Schema $schema */
$schema = $this->connection
->schema();
$this->schema = $schema;
$this->table = [
'description' => 'New Comment',
'fields' => [
'id' => [
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
],
'name' => [
'description' => "A person's name",
'type' => 'varchar_ascii',
'length' => 255,
'not null' => TRUE,
'default' => '',
'binary' => TRUE,
],
'age' => [
'description' => "The person's age",
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
],
'job' => [
'description' => "The person's job",
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => 'Undefined',
],
],
'primary key' => [
'id',
],
'unique keys' => [
'name' => [
'name',
],
],
'indexes' => [
'ages' => [
'age',
],
],
];
}