function DriverSpecificSchemaTestBase::providerTestSchemaCreateTablePrimaryKey

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSchemaTestBase.php \Drupal\KernelTests\Core\Database\DriverSpecificSchemaTestBase::providerTestSchemaCreateTablePrimaryKey()

Provides test cases for SchemaTest::testSchemaCreateTablePrimaryKey().

Return value

array An array of test cases for SchemaTest::testSchemaCreateTablePrimaryKey().

File

core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSchemaTestBase.php, line 654

Class

DriverSpecificSchemaTestBase
Tests table creation and modification via the schema API.

Namespace

Drupal\KernelTests\Core\Database

Code

public static function providerTestSchemaCreateTablePrimaryKey() {
  $tests = [];
  $tests['simple_primary_key'] = [
    'initial_primary_key' => [
      'test_field',
    ],
    'renamed_primary_key' => [
      'test_field_renamed',
    ],
  ];
  $tests['composite_primary_key'] = [
    'initial_primary_key' => [
      'test_field',
      'other_test_field',
    ],
    'renamed_primary_key' => [
      'test_field_renamed',
      'other_test_field',
    ],
  ];
  $tests['composite_primary_key_different_order'] = [
    'initial_primary_key' => [
      'other_test_field',
      'test_field',
    ],
    'renamed_primary_key' => [
      'other_test_field',
      'test_field_renamed',
    ],
  ];
  return $tests;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.