@@ -31,7 +31,7 @@ class Person
31
31
}
32
32
33
33
34
- test ('' , function () {
34
+ test ('store and retrieve values via array and property notation ' , function () {
35
35
$ list = new ArrayHash ;
36
36
$ jack = new Person ('Jack ' );
37
37
$ mary = new Person ('Mary ' );
@@ -79,7 +79,7 @@ test('', function () {
79
79
});
80
80
81
81
82
- test ('' , function () {
82
+ test ('creation with non‐recursive conversion leaves nested arrays unchanged ' , function () {
83
83
$ mary = new Person ('Mary ' );
84
84
$ list = ArrayHash::from ([
85
85
'm ' => $ mary ,
@@ -93,7 +93,7 @@ test('', function () {
93
93
});
94
94
95
95
96
- test ('' , function () {
96
+ test ('recursive conversion transforms nested arrays into ArrayHash ' , function () {
97
97
$ mary = new Person ('Mary ' );
98
98
$ list = ArrayHash::from ([
99
99
'm ' => $ mary ,
@@ -121,7 +121,7 @@ test('', function () {
121
121
});
122
122
123
123
124
- test ('numeric fields ' , function () {
124
+ test ('numeric key handling supports both integer and string offsets ' , function () {
125
125
$ row = ArrayHash::from ([1 , 2 ]);
126
126
127
127
foreach ($ row as $ key => $ value ) {
@@ -171,7 +171,7 @@ test('numeric fields', function () {
171
171
});
172
172
173
173
174
- test ('null fields ' , function () {
174
+ test ('null values are stored but not regarded as set ' , function () {
175
175
$ row = ArrayHash::from (['null ' => null ]);
176
176
Assert::null ($ row ->null );
177
177
Assert::null ($ row ['null ' ]);
@@ -180,7 +180,7 @@ test('null fields', function () {
180
180
});
181
181
182
182
183
- test ('undeclared fields ' , function () {
183
+ test ('accessing undefined keys triggers a notice or warning ' , function () {
184
184
$ row = new ArrayHash ;
185
185
Assert::error (
186
186
fn () => $ row ->undef ,
@@ -196,7 +196,7 @@ test('undeclared fields', function () {
196
196
});
197
197
198
198
199
- test ('PHP 7 changed behavior https://3v4l.org/2A1pf ' , function () {
199
+ test ('unsetting entries during iteration removes them ' , function () {
200
200
$ hash = ArrayHash::from ([1 , 2 , 3 ]);
201
201
foreach ($ hash as $ key => $ value ) {
202
202
unset($ hash ->$ key );
@@ -206,7 +206,7 @@ test('PHP 7 changed behavior https://3v4l.org/2A1pf', function () {
206
206
});
207
207
208
208
209
- test ('iteration with reference ' , function () {
209
+ test ('reference iteration allows modification of all elements ' , function () {
210
210
$ hash = ArrayHash::from ([1 , 2 , 3 ]);
211
211
foreach ($ hash as $ key => &$ value ) {
212
212
$ value = 'new ' ;
0 commit comments