function UpdateSchemaTest::testDrupalGetSchemaVersionsInt

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Extension/UpdateSchemaTest.php \Drupal\KernelTests\Core\Extension\UpdateSchemaTest::testDrupalGetSchemaVersionsInt()
  2. 10 core/tests/Drupal/KernelTests/Core/Extension/UpdateSchemaTest.php \Drupal\KernelTests\Core\Extension\UpdateSchemaTest::testDrupalGetSchemaVersionsInt()

Tests the function parses schema updates as integer numbers.

See also

\Drupal\Core\Update\UpdateHookRegistry::getAvailableUpdates()

File

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

Class

UpdateSchemaTest
Tests for schema and update includes.

Namespace

Drupal\KernelTests\Core\Extension

Code

public function testDrupalGetSchemaVersionsInt() : void {
    \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.