@@ -1005,5 +1005,65 @@ public function testVcardGeoNoImpliedName() {
10051005
10061006 $ this ->assertArrayNotHasKey ('name ' , $ output ['items ' ][0 ]['properties ' ]['geo ' ][0 ]['properties ' ]);
10071007 }
1008+
1009+ /**
1010+ * @see https://github.com/microformats/php-mf2/issues/184
1011+ */
1012+ public function testVeventLocationVcardProperty () {
1013+ $ input = '<div class="vevent">
1014+ <a class="summary url" href="http://indiewebcamp.com/2012">
1015+ IndieWebCamp 2012
1016+ </a>
1017+ from <time class="dtstart">2012-06-30</time>
1018+ to <time class="dtend">2012-07-01</time> at
1019+ <span class="location vcard">
1020+ <a class="fn org url" href="http://geoloqi.com/">Geoloqi</a>,
1021+ <span class="adr">
1022+ <span class="street-address">920 SW 3rd Ave. Suite 400</span>,
1023+ <span class="locality">Portland</span>,
1024+ <abbr class="region" title="Oregon">OR</abbr>
1025+ </span>
1026+ </span>
1027+ </div> ' ;
1028+ $ parser = new Parser ($ input , 'https://example.com ' );
1029+ $ output = $ parser ->parse ();
1030+
1031+ $ this ->assertArrayHasKey ('location ' , $ output ['items ' ][0 ]['properties ' ]);
1032+ $ this ->assertCount (1 , $ output ['items ' ][0 ]['properties ' ]['location ' ][0 ]['type ' ]);
1033+ $ this ->assertEquals ('h-card ' , $ output ['items ' ][0 ]['properties ' ]['location ' ][0 ]['type ' ][0 ]);
1034+ }
1035+
1036+ /**
1037+ * @see https://github.com/microformats/php-mf2/issues/184
1038+ */
1039+ public function testVeventLocationAdrProperty () {
1040+ $ input = '<div class="vevent">
1041+ <span class="summary">CPJ Online Press Freedom Summit</span>
1042+ (<time class="dtstart" datetime="2012-10-10">10 Nov 2012</time>) in
1043+ <span class="location adr"><span class="street-address">665 3rd St.</span><span class="locality">San Francisco</span>, <span class="region">CA</span> </span>.
1044+ </div> ' ;
1045+ $ parser = new Parser ($ input , 'https://example.com ' );
1046+ $ output = $ parser ->parse ();
1047+
1048+ $ this ->assertArrayHasKey ('location ' , $ output ['items ' ][0 ]['properties ' ]);
1049+ $ this ->assertCount (1 , $ output ['items ' ][0 ]['properties ' ]['location ' ][0 ]['type ' ]);
1050+ $ this ->assertEquals ('h-adr ' , $ output ['items ' ][0 ]['properties ' ]['location ' ][0 ]['type ' ][0 ]);
1051+ }
1052+
1053+ /**
1054+ * @see https://github.com/microformats/php-mf2/issues/184
1055+ */
1056+ public function testVeventLocationProperty () {
1057+ $ input = '<div class="vevent">
1058+ <span class="summary">CPJ Online Press Freedom Summit</span>
1059+ (<time class="dtstart" datetime="2012-10-10">10 Nov 2012</time>) in
1060+ <span class="location">San Francisco</span>.
1061+ </div> ' ;
1062+ $ parser = new Parser ($ input , 'https://example.com ' );
1063+ $ output = $ parser ->parse ();
1064+
1065+ $ this ->assertArrayHasKey ('location ' , $ output ['items ' ][0 ]['properties ' ]);
1066+ $ this ->assertEquals ('San Francisco ' , $ output ['items ' ][0 ]['properties ' ]['location ' ][0 ]);
1067+ }
10081068}
10091069
0 commit comments