File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 88class Header implements \ArrayAccess, \IteratorAggregate, \Countable
99{
1010 /** @var array normalized key name map */
11- private $ data ;
11+ private $ data = array () ;
1212
1313 /**
1414 * @param array $obj non-normalized header object
Original file line number Diff line number Diff line change @@ -145,6 +145,21 @@ public function testGetIterator()
145145 $ this ->assertFalse ($ hasException );
146146 }
147147
148+ public function testEmptyHeaderIterator ()
149+ {
150+ $ emptyHeader = new Header ();
151+
152+ $ hasException = false ;
153+ try {
154+ foreach ($ emptyHeader as $ k => $ v ) {
155+ $ hasException = !isset ($ header [$ k ]);
156+ }
157+ } catch (\Exception $ e ) {
158+ $ hasException = true ;
159+ }
160+ $ this ->assertFalse ($ hasException );
161+ }
162+
148163 public function testCount ()
149164 {
150165 $ header = new Header ($ this ->heads );
You can’t perform that action at this time.
0 commit comments