function DependencyHookInvocationTest::testHookUpdateDependencies

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

File

drupal/core/modules/system/lib/Drupal/system/Tests/Update/DependencyHookInvocationTest.php, line 40
Definition of Drupal\system\Tests\Update\DependencyHookInvocationTest.

Class

DependencyHookInvocationTest
Tests the invocation of hook_update_dependencies().

Namespace

Drupal\system\Tests\Update

Code

function testHookUpdateDependencies() {
  $update_dependencies = update_retrieve_dependencies();
  $this
    ->assertTrue($update_dependencies['system'][8000]['update_test_1'] == 8000, 'An update function that has a dependency on two separate modules has the first dependency recorded correctly.');
  $this
    ->assertTrue($update_dependencies['system'][8000]['update_test_2'] == 8001, 'An update function that has a dependency on two separate modules has the second dependency recorded correctly.');
  $this
    ->assertTrue($update_dependencies['system'][8001]['update_test_1'] == 8002, '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.');
}