You are here

public function SchemaTest::testFieldExistsException in Drupal driver for SQL Server and SQL Azure 8.2

Same name and namespace in other branches
  1. 4.2.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::testFieldExistsException()
  2. 3.0.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::testFieldExistsException()
  3. 3.1.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::testFieldExistsException()
  4. 4.0.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::testFieldExistsException()
  5. 4.1.x tests/src/Kernel/SchemaTest.php \Drupal\Tests\sqlsrv\Kernel\SchemaTest::testFieldExistsException()

Exception thrown when field already exists.

File

tests/src/Kernel/SchemaTest.php, line 288

Class

SchemaTest
Tests table creation and modification via the schema API.

Namespace

Drupal\Tests\sqlsrv\Kernel

Code

public function testFieldExistsException() {
  $this
    ->expectException(SchemaObjectExistsException::class);
  $this->schema
    ->changeField('test', 'age', 'name', $this->table['fields']['age']);
}