@@ -65,6 +65,11 @@ class ParserTest extends BaseTestCase
65
65
*/
66
66
private $ authorAttr ;
67
67
68
+ /**
69
+ * @var array
70
+ */
71
+ private $ authorAttrNull ;
72
+
68
73
/**
69
74
* @var array
70
75
*/
@@ -132,6 +137,11 @@ protected function setUp()
132
137
Author::ATTRIBUTE_LAST_NAME => $ this ->author ->{Author::ATTRIBUTE_LAST_NAME },
133
138
];
134
139
140
+ $ this ->authorAttrNull = [
141
+ Author::ATTRIBUTE_FIRST_NAME => null ,
142
+ Author::ATTRIBUTE_LAST_NAME => null ,
143
+ ];
144
+
135
145
$ this ->commAttr5 = [
136
146
Comment::ATTRIBUTE_BODY => $ this ->comments [0 ]->{Comment::ATTRIBUTE_BODY },
137
147
];
@@ -204,15 +214,15 @@ public function testParseObjectWithCircularReferences()
204
214
$ start = ParserReplyInterface::REPLY_TYPE_RESOURCE_STARTED ;
205
215
$ complete = ParserReplyInterface::REPLY_TYPE_RESOURCE_COMPLETED ;
206
216
$ expected = [
207
- // level link name type id attributes meta
208
- [$ start , 1 , '' , 'people ' , 9 , $ this ->authorAttr , null ],
209
- [$ start , 2 , 'comments ' , 'comments ' , 5 , $ this ->commAttr5 , null ],
210
- [$ start , 3 , 'author ' , 'people ' , 9 , $ this ->authorAttr , null ],
211
- [$ complete , 2 , 'comments ' , 'comments ' , 5 , $ this ->commAttr5 , null ],
212
- [$ start , 2 , 'comments ' , 'comments ' , 12 , $ this ->commAttr12 , null ],
213
- [$ start , 3 , 'author ' , 'people ' , 9 , $ this ->authorAttr , null ],
214
- [$ complete , 2 , 'comments ' , 'comments ' , 12 , $ this ->commAttr12 , null ],
215
- [$ complete , 1 , '' , 'people ' , 9 , $ this ->authorAttr , null ],
217
+ // level link name type id attributes meta
218
+ [$ start , 1 , '' , 'people ' , 9 , $ this ->authorAttr , null ],
219
+ [$ start , 2 , 'comments ' , 'comments ' , 5 , $ this ->commAttr5 , null ],
220
+ [$ start , 3 , 'author ' , 'people ' , 9 , $ this ->authorAttrNull , null ],
221
+ [$ complete , 2 , 'comments ' , 'comments ' , 5 , $ this ->commAttr5 , null ],
222
+ [$ start , 2 , 'comments ' , 'comments ' , 12 , $ this ->commAttr12 , null ],
223
+ [$ start , 3 , 'author ' , 'people ' , 9 , $ this ->authorAttrNull , null ],
224
+ [$ complete , 2 , 'comments ' , 'comments ' , 12 , $ this ->commAttr12 , null ],
225
+ [$ complete , 1 , '' , 'people ' , 9 , $ this ->authorAttr , null ],
216
226
];
217
227
218
228
$ allReplies = [];
0 commit comments