Verified Commit d5ffb679 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3121155 by quietone, lauriii, bnjmnm, tedbow: Add comments about...

Issue #3121155 by quietone, lauriii, bnjmnm, tedbow: Add comments about alphabetical sorting in UpdateRegistry and test

(cherry picked from commit 218f375f)
parent 90baffa4
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ public function getRemovedPostUpdates($extension) {
   * Gets all available update functions.
   *
   * @return callable[]
   *   A list of update functions.
   *   An alphabetical list of available update functions.
   */
  protected function getAvailableUpdateFunctions() {
    $regexp = '/^(?<extension>.+)_' . $this->updateType . '_(?<name>.+)$/';
@@ -163,7 +163,7 @@ protected function getAvailableUpdateFunctions() {
   * Find all update functions that haven't been executed.
   *
   * @return callable[]
   *   A list of update functions.
   *   An alphabetical list of update functions that have not been executed.
   */
  public function getPendingUpdateFunctions() {
    // We need a) the list of active extensions (we get that from the config
+5 −0
Original line number Diff line number Diff line
@@ -213,6 +213,7 @@ public function testGetPendingUpdateFunctionsNoExistingUpdates() {
        ],
    ], $key_value, $theme_handler, 'post_update');

    // Confirm the updates are sorted alphabetically.
    $this->assertEquals([
      'module_a_post_update_a',
      'module_a_post_update_b',
@@ -250,6 +251,7 @@ public function testGetPendingUpdateFunctionsWithLoadedModulesButNotEnabled() {
        ],
    ], $key_value, $theme_handler, 'post_update');

    // Confirm the updates are sorted alphabetically.
    $this->assertEquals([
      'module_a_post_update_a',
      'module_a_post_update_b',
@@ -294,6 +296,7 @@ public function testGetPendingUpdateFunctionsExistingUpdates() {
        ],
    ], $key_value, $theme_handler, 'post_update');

    // Confirm the updates are sorted alphabetically.
    $this->assertEquals(array_values([
      'module_a_post_update_b',
      'module_b_post_update_a',
@@ -336,6 +339,7 @@ public function testGetPendingUpdateInformation() {
        ],
    ], $key_value, $theme_handler, 'post_update');

    // Confirm the updates are sorted alphabetically.
    $expected = [];
    $expected['module_a']['pending']['a'] = 'Module A update A.';
    $expected['module_a']['pending']['b'] = 'Module A update B.';
@@ -387,6 +391,7 @@ public function testGetPendingUpdateInformationWithExistingUpdates() {
        ],
    ], $key_value, $theme_handler, 'post_update');

    // Confirm the updates are sorted alphabetically.
    $expected = [];
    $expected['module_a']['pending']['b'] = 'Module A update B.';
    $expected['module_a']['start'] = 'b';