class UpdateSchemaTest

Same name in this branch
  1. 9 core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdateSchemaTest
Same name and namespace in other branches
  1. 11.x core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdateSchemaTest
  2. 11.x core/tests/Drupal/KernelTests/Core/Extension/UpdateSchemaTest.php \Drupal\KernelTests\Core\Extension\UpdateSchemaTest
  3. 10 core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdateSchemaTest
  4. 10 core/tests/Drupal/KernelTests/Core/Extension/UpdateSchemaTest.php \Drupal\KernelTests\Core\Extension\UpdateSchemaTest
  5. 8.9.x core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdateSchemaTest

Tests for schema and update includes.

@group Core

Hierarchy

Expanded class hierarchy of UpdateSchemaTest

File

core/tests/Drupal/KernelTests/Core/Extension/UpdateSchemaTest.php, line 12

Namespace

Drupal\KernelTests\Core\Extension
View source
class UpdateSchemaTest extends KernelTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'update_test_schema',
  ];
  
  /**
   * Tests the function parses schema updates as integer numbers.
   *
   * @see \Drupal\Core\Update\UpdateHookRegistry::getAvailableUpdates()
   */
  public function testDrupalGetSchemaVersionsInt() {
    \Drupal::state()->set('update_test_schema_version', 8001);
    $this->installSchema('update_test_schema', [
      'update_test_schema_table',
    ]);
    $schema = \Drupal::service('update.update_hook_registry')->getAvailableUpdates('update_test_schema');
    foreach ($schema as $version) {
      $this->assertIsInt($version);
    }
  }

}

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