function DependencyHookInvocationTest::testHookUpdateDependencies

Same name in other branches
  1. 8.9.x core/modules/system/tests/src/Functional/UpdateSystem/DependencyHookInvocationTest.php \Drupal\Tests\system\Functional\UpdateSystem\DependencyHookInvocationTest::testHookUpdateDependencies()
  2. 10 core/modules/system/tests/src/Functional/UpdateSystem/DependencyHookInvocationTest.php \Drupal\Tests\system\Functional\UpdateSystem\DependencyHookInvocationTest::testHookUpdateDependencies()
  3. 11.x core/modules/system/tests/src/Functional/UpdateSystem/DependencyHookInvocationTest.php \Drupal\Tests\system\Functional\UpdateSystem\DependencyHookInvocationTest::testHookUpdateDependencies()

Tests the structure of the array returned by hook_update_dependencies().

File

core/modules/system/tests/src/Functional/UpdateSystem/DependencyHookInvocationTest.php, line 41

Class

DependencyHookInvocationTest
Tests the hook invocation for determining update dependencies.

Namespace

Drupal\Tests\system\Functional\UpdateSystem

Code

public function testHookUpdateDependencies() {
    $update_dependencies = update_retrieve_dependencies();
    $this->assertSame(8001, $update_dependencies['update_test_0'][8001]['update_test_1'], 'An update function that has a dependency on two separate modules has the first dependency recorded correctly.');
    $this->assertSame(8002, $update_dependencies['update_test_0'][8001]['update_test_2'], 'An update function that has a dependency on two separate modules has the second dependency recorded correctly.');
    $this->assertSame(8003, $update_dependencies['update_test_0'][8002]['update_test_1'], 'An update function that depends on more than one update from the same module only has the dependency on the higher-numbered update function recorded.');
}

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