N°7157 - Fix ValueSetEnum values as array must conserve keys

This commit is contained in:
Molkobain
2024-03-07 11:16:27 +01:00
parent 7ac283bffb
commit 4d1f8e5704
2 changed files with 15 additions and 7 deletions

View File

@@ -64,7 +64,7 @@ class ValueSetEnumTest extends ItopTestCase
"c" => "c",
],
],
"Array, already ordered" => [
"Array without keys, already ordered" => [
["a", "b", "c"],
[
0 => "a",
@@ -72,12 +72,20 @@ class ValueSetEnumTest extends ItopTestCase
2 => "c",
],
],
"Array with keys, already ordered" => [
["a" => "a", "b" => "b", "c" => "c"],
[
"a" => "a",
"b" => "b",
"c" => "c",
],
],
"Backed-Enum" => [
ABCEnum::class,
[
0 => "a",
1 => "b",
2 => "c",
"a" => "a",
"b" => "b",
"c" => "c",
],
true, // Is the input value a backed enum?
],