@@ -31,7 +31,7 @@ class Person
3131}
3232
3333
34- test ('' , function () {
34+ test ('store and retrieve values via array and property notation ' , function () {
3535 $ list = new ArrayHash ;
3636 $ jack = new Person ('Jack ' );
3737 $ mary = new Person ('Mary ' );
@@ -79,7 +79,7 @@ test('', function () {
7979});
8080
8181
82- test ('' , function () {
82+ test ('creation with non‐recursive conversion leaves nested arrays unchanged ' , function () {
8383 $ mary = new Person ('Mary ' );
8484 $ list = ArrayHash::from ([
8585 'm ' => $ mary ,
@@ -93,7 +93,7 @@ test('', function () {
9393});
9494
9595
96- test ('' , function () {
96+ test ('recursive conversion transforms nested arrays into ArrayHash ' , function () {
9797 $ mary = new Person ('Mary ' );
9898 $ list = ArrayHash::from ([
9999 'm ' => $ mary ,
@@ -121,7 +121,7 @@ test('', function () {
121121});
122122
123123
124- test ('numeric fields ' , function () {
124+ test ('numeric key handling supports both integer and string offsets ' , function () {
125125 $ row = ArrayHash::from ([1 , 2 ]);
126126
127127 foreach ($ row as $ key => $ value ) {
@@ -171,7 +171,7 @@ test('numeric fields', function () {
171171});
172172
173173
174- test ('null fields ' , function () {
174+ test ('null values are stored but not regarded as set ' , function () {
175175 $ row = ArrayHash::from (['null ' => null ]);
176176 Assert::null ($ row ->null );
177177 Assert::null ($ row ['null ' ]);
@@ -180,7 +180,7 @@ test('null fields', function () {
180180});
181181
182182
183- test ('undeclared fields ' , function () {
183+ test ('accessing undefined keys triggers a notice or warning ' , function () {
184184 $ row = new ArrayHash ;
185185 Assert::error (
186186 fn () => $ row ->undef ,
@@ -196,7 +196,7 @@ test('undeclared fields', function () {
196196});
197197
198198
199- test ('PHP 7 changed behavior https://3v4l.org/2A1pf ' , function () {
199+ test ('unsetting entries during iteration removes them ' , function () {
200200 $ hash = ArrayHash::from ([1 , 2 , 3 ]);
201201 foreach ($ hash as $ key => $ value ) {
202202 unset($ hash ->$ key );
@@ -206,7 +206,7 @@ test('PHP 7 changed behavior https://3v4l.org/2A1pf', function () {
206206});
207207
208208
209- test ('iteration with reference ' , function () {
209+ test ('reference iteration allows modification of all elements ' , function () {
210210 $ hash = ArrayHash::from ([1 , 2 , 3 ]);
211211 foreach ($ hash as $ key => &$ value ) {
212212 $ value = 'new ' ;
0 commit comments