@@ -11,6 +11,7 @@ public function testBuildFromArray()
1111 $ this ->assertEquals (true , $ dto ->get ('foo ' ));
1212 $ this ->assertEquals ('string ' , $ dto ->get ('bar ' ));
1313 $ this ->assertEquals (['a ' => 'b ' ], $ dto ->get ('extra ' ));
14+ $ this ->assertEquals (null , $ dto ->get ('some ' ));
1415 }
1516
1617 public function testBuildFromJson ()
@@ -77,7 +78,7 @@ public function testCount()
7778 {
7879 $ dto = new ExampleDTO ();
7980
80- $ this ->assertCount (3 , $ dto );
81+ $ this ->assertCount (4 , $ dto );
8182 }
8283
8384 public function testOffsetExists ()
@@ -136,22 +137,22 @@ public function testToString()
136137 {
137138 $ dto = new ExampleDTO ();
138139
139- $ this ->assertEquals ('{"foo":true,"bar":"string","extra":{"a":"b"}} ' , (string )$ dto );
140+ $ this ->assertEquals ('{"foo":true,"bar":"string","extra":{"a":"b"},"some":null } ' , (string )$ dto );
140141 }
141142
142143 public function testToStringWithCustomSerializer ()
143144 {
144145 $ dto = new ExampleDTO ();
145146 $ dto ->setSerializer (new CustomSerializer ());
146147
147- $ this ->assertEquals ('a:3 :{s:3:"foo";b:1;s:3:"bar";s:6:"string";s:5:"extra";a:1:{s:1:"a";s:1:"b";}} ' , (string )$ dto );
148+ $ this ->assertEquals ('a:4 :{s:3:"foo";b:1;s:3:"bar";s:6:"string";s:5:"extra";a:1:{s:1:"a";s:1:"b";}s:4:"some";N; } ' , (string )$ dto );
148149 }
149150
150151 public function testCanIterateDTO ()
151152 {
152153 $ dto = new ExampleDTO ();
153154
154- $ expectedArray = ['foo ' => true , 'bar ' => 'string ' , 'extra ' => ['a ' => 'b ' ]];
155+ $ expectedArray = ['foo ' => true , 'bar ' => 'string ' , 'extra ' => ['a ' => 'b ' ], ' some ' => null ];
155156 $ gotArray = [];
156157
157158 foreach ($ dto as $ key => $ value ) {
0 commit comments