You are here

public function SchemaTest::testPrimaryKeyExistsException in Drupal driver for SQL Server and SQL Azure 3.1.x

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

Exception thrown when primary key already exists.

File

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

Class

SchemaTest
Tests table creation and modification via the schema API.

Namespace

Drupal\Tests\sqlsrv\Kernel

Code

public function testPrimaryKeyExistsException() {
  $this
    ->expectException(SchemaObjectExistsException::class);
  $this->schema
    ->addPrimaryKey('test', 'name');
}