function UpdateHookRegistryTest::testGetVersions

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Core/Update/UpdateHookRegistryTest.php \Drupal\Tests\Core\Update\UpdateHookRegistryTest::testGetVersions()
  2. 11.x core/tests/Drupal/Tests/Core/Update/UpdateHookRegistryTest.php \Drupal\Tests\Core\Update\UpdateHookRegistryTest::testGetVersions()

@covers ::getAvailableUpdates

File

core/tests/Drupal/Tests/Core/Update/UpdateHookRegistryTest.php, line 91

Class

UpdateHookRegistryTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Update%21UpdateHookRegistry.php/class/UpdateHookRegistry/9" title="Provides module updates versions handling." class="local">\Drupal\Core\Update\UpdateHookRegistry</a> @group Update

Namespace

Drupal\Tests\Core\Update

Code

public function testGetVersions() {
    $module_name = 'drupal\\tests\\core\\update\\under_test';
    $update_registry = new UpdateHookRegistry([], $this->keyValueStore);
    // Only under_test_update_X - passes through the filter.
    $expected = [
        1,
        20,
        3000,
    ];
    $actual = $update_registry->getAvailableUpdates($module_name);
    $this->assertSame($expected, $actual);
}

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