File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -423,10 +423,16 @@ public function testMf2DoesNotParseRelTag() {
423423 */
424424 public function testEmptyPropertiesObjectInJSONMode () {
425425 $ input = '<div class="h-feed"><div class="h-entry"></div></div> ' ;
426+ // Try in JSON-mode: expect the raw PHP to be an stdClass instance that serializes to an empty object.
426427 $ parser = new Parser ($ input , null , true );
427428 $ output = $ parser ->parse ();
428429 $ this ->assertInstanceOf ('\stdClass ' , $ output ['items ' ][0 ]['properties ' ]);
429430 $ this ->assertSame ('{} ' , json_encode ($ output ['items ' ][0 ]['properties ' ]));
431+ // Repeat in non-JSON-mode: expect the raw PHP to be an array. Check that its serialization is not what we need for mf2 JSON.
432+ $ parser = new Parser ($ input , null , false );
433+ $ output = $ parser ->parse ();
434+ $ this ->assertInternalType ('array ' , $ output ['items ' ][0 ]['properties ' ]);
435+ $ this ->assertSame ('[] ' , json_encode ($ output ['items ' ][0 ]['properties ' ]));
430436 }
431437
432438}
You can’t perform that action at this time.
0 commit comments