File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -285,4 +285,25 @@ public function testAreaTag() {
285
285
$ this ->assertEquals ('Person Bee ' , $ output ['items ' ][0 ]['properties ' ]['category ' ][0 ]['value ' ]);
286
286
287
287
}
288
+
289
+ public function testParseHcardInCategory () {
290
+
291
+ $ input = '<span class="h-entry">
292
+ <a class="p-author h-card" href="http://a.example.com/">Alice</a> tagged
293
+ <a href="http://b.example.com/" class="p-category h-card">Bob Smith</a> in
294
+ <a class="u-tag-of u-in-reply-to" href="http://s.example.com/permalink47">
295
+ <img src="http://s.example.com/photo47.png" alt="a photo of Bob and Cole" /></a>
296
+ </span> ' ;
297
+
298
+ $ parser = new Parser ($ input );
299
+ $ output = $ parser ->parse ();
300
+
301
+ $ this ->assertContains ('h-entry ' , $ output ['items ' ][0 ]['type ' ]);
302
+ $ this ->assertArrayHasKey ('category ' , $ output ['items ' ][0 ]['properties ' ]);
303
+ $ this ->assertContains ('h-card ' , $ output ['items ' ][0 ]['properties ' ]['category ' ][0 ]['type ' ]);
304
+ $ this ->assertArrayHasKey ('name ' , $ output ['items ' ][0 ]['properties ' ]['category ' ][0 ]['properties ' ]);
305
+ $ this ->assertEquals ('Bob Smith ' , $ output ['items ' ][0 ]['properties ' ]['category ' ][0 ]['properties ' ]['name ' ][0 ]);
306
+ $ this ->assertArrayHasKey ('url ' , $ output ['items ' ][0 ]['properties ' ]['category ' ][0 ]['properties ' ]);
307
+ $ this ->assertEquals ('http://b.example.com/ ' , $ output ['items ' ][0 ]['properties ' ]['category ' ][0 ]['properties ' ]['url ' ][0 ]);
308
+ }
288
309
}
You can’t perform that action at this time.
0 commit comments