Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment