function DependencyOrderingTest::testUpdateOrderingSingleModule

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

Tests that updates within a single module run in the correct order.

File

core/modules/system/tests/src/Functional/UpdateSystem/DependencyOrderingTest.php, line 42

Class

DependencyOrderingTest
Tests that update functions are run in the proper order.

Namespace

Drupal\Tests\system\Functional\UpdateSystem

Code

public function testUpdateOrderingSingleModule() {
    $starting_updates = [
        'update_test_1' => 8001,
    ];
    $expected_updates = [
        'update_test_1_update_8001',
        'update_test_1_update_8002',
        'update_test_1_update_8003',
    ];
    $actual_updates = array_keys(update_resolve_dependencies($starting_updates));
    $this->assertEquals($expected_updates, $actual_updates, 'Updates within a single module run in the correct order.');
}

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