Test that indexes are preserved

This commit is contained in:
Andrea Marco Sartori 2023-01-14 10:15:25 +10:00
parent 45ed8e9650
commit b09b738173
2 changed files with 66 additions and 58 deletions

View File

@ -14,34 +14,38 @@ return [
],
'/-/batters/batter/-,/-/name' => [
'name' => ['Cake', 'Raised', 'Old Fashioned'],
[
"id" => "1001",
"type" => "Regular",
0 => [
[
"id" => "1001",
"type" => "Regular",
],
[
"id" => "1001",
"type" => "Regular",
],
[
"id" => "1001",
"type" => "Regular",
],
],
[
"id" => "1002",
"type" => "Chocolate",
1 => [
[
"id" => "1002",
"type" => "Chocolate",
],
[
"id" => "1002",
"type" => "Chocolate",
],
],
[
2 => [
"id" => "1003",
"type" => "Blueberry",
],
[
3 => [
"id" => "1004",
"type" => "Devil's Food",
],
[
"id" => "1001",
"type" => "Regular",
],
[
"id" => "1001",
"type" => "Regular",
],
[
"id" => "1002",
"type" => "Chocolate",
],
],
],
'complex_object' => [
@ -85,14 +89,14 @@ return [
],
'simple_array' => [
'/-1,/-2' => [],
'/0,/1' => [1, ''],
'/1,/0' => [1, ''],
'/0,/2' => [1, 'foo'],
'/2,/3' => ['foo', '"bar"'],
'/3,/4,/5' => ['"bar"', 'hej då', 3.14],
'/4,/5,/3' => ['"bar"', 'hej då', 3.14],
'/6,/7,/8,/9' => [false, null, [], []],
'/9,/8,/7,/6' => [false, null, [], []],
'/0,/1' => [0 => 1, 1 => ''],
'/1,/0' => [0 => 1, 1 => ''],
'/0,/2' => [0 => 1, 2 => 'foo'],
'/2,/3' => [2 => 'foo', 3 => '"bar"'],
'/3,/4,/5' => [3 => '"bar"', 4 => 'hej då', 5 => 3.14],
'/4,/5,/3' => [3 => '"bar"', 4 => 'hej då', 5 => 3.14],
'/6,/7,/8,/9' => [6 => false, 7 => null, 8 => [], 9 => []],
'/9,/8,/7,/6' => [6 => false, 7 => null, 8 => [], 9 => []],
],
'simple_object' => [
'/-1,/-2' => [],

View File

@ -88,34 +88,38 @@ return [
],
],
'/-/batters/batter/-' => [
[
"id" => "1001",
"type" => "Regular",
0 => [
[
"id" => "1001",
"type" => "Regular",
],
[
"id" => "1001",
"type" => "Regular",
],
[
"id" => "1001",
"type" => "Regular",
],
],
[
"id" => "1002",
"type" => "Chocolate",
1 => [
[
"id" => "1002",
"type" => "Chocolate",
],
[
"id" => "1002",
"type" => "Chocolate",
],
],
[
2 => [
"id" => "1003",
"type" => "Blueberry",
],
[
3 => [
"id" => "1004",
"type" => "Devil's Food",
],
[
"id" => "1001",
"type" => "Regular",
],
[
"id" => "1001",
"type" => "Regular",
],
[
"id" => "1002",
"type" => "Chocolate",
],
],
'/-/batters/batter/-/id' => ['id' => ["1001", "1002", "1003", "1004", "1001", "1001", "1002"]],
],
@ -203,16 +207,16 @@ return [
'' => $simpleArray = require __DIR__ . '/../parsing/simple_array.php',
'/-' => $simpleArray,
'/-1' => [],
'/0' => [1],
'/1' => [''],
'/2' => ['foo'],
'/3' => ['"bar"'],
'/4' => ['hej då'],
'/5' => [3.14],
'/6' => [false],
'/7' => [null],
'/8' => [[]],
'/9' => [[]],
'/0' => [0 => 1],
'/1' => [1 => ''],
'/2' => [2 => 'foo'],
'/3' => [3 => '"bar"'],
'/4' => [4 => 'hej då'],
'/5' => [5 => 3.14],
'/6' => [6 => false],
'/7' => [7 => null],
'/8' => [8 => []],
'/9' => [9 => []],
'/10' => [],
'/foo' => [],
],