@@ -1005,5 +1005,71 @@ 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+ // Note: The venue for IWC 2012 no longer exists so we switched
1014+ // this to Powell's since it's a long-term Portland institution
1015+ $ input = '<div class="vevent">
1016+ <a class="summary url" href="https://indieweb.org/2012">
1017+ IndieWebCamp 2012
1018+ </a>
1019+ from <time class="dtstart">2012-06-30</time>
1020+ to <time class="dtend">2012-07-01</time> at
1021+ <span class="location vcard">
1022+ <a class="fn org url" href="https://www.powells.com/">Powell’s</a>,
1023+ <span class="adr">
1024+ <span class="street-address">1005 W Burnside St.</span>,
1025+ <span class="locality">Portland</span>,
1026+ <abbr class="region" title="Oregon">OR</abbr>
1027+ </span>
1028+ </span>
1029+ </div> ' ;
1030+ $ parser = new Parser ($ input , 'https://example.com ' );
1031+ $ output = $ parser ->parse ();
1032+
1033+ $ this ->assertArrayHasKey ('location ' , $ output ['items ' ][0 ]['properties ' ]);
1034+ $ this ->assertCount (1 , $ output ['items ' ][0 ]['properties ' ]['location ' ][0 ]['type ' ]);
1035+ $ this ->assertEquals ('h-card ' , $ output ['items ' ][0 ]['properties ' ]['location ' ][0 ]['type ' ][0 ]);
1036+ }
1037+
1038+ /**
1039+ * @see https://github.com/microformats/php-mf2/issues/184
1040+ */
1041+ public function testVeventLocationAdrProperty () {
1042+ // date fix, see: https://cpj.org/2012/10/cpj-impact-43/
1043+ // "second annual Online Press Freedom Summit in San Francisco on October 10"
1044+ $ input = '<div class="vevent">
1045+ <span class="summary">CPJ Online Press Freedom Summit</span>
1046+ (<time class="dtstart" datetime="2012-10-10">10 Oct 2012</time>) in
1047+ <span class="location adr"><span class="street-address">665 3rd St.</span><span class="locality">San Francisco</span>, <span class="region">CA</span> </span>.
1048+ </div> ' ;
1049+ $ parser = new Parser ($ input , 'https://example.com ' );
1050+ $ output = $ parser ->parse ();
1051+
1052+ $ this ->assertArrayHasKey ('location ' , $ output ['items ' ][0 ]['properties ' ]);
1053+ $ this ->assertCount (1 , $ output ['items ' ][0 ]['properties ' ]['location ' ][0 ]['type ' ]);
1054+ $ this ->assertEquals ('h-adr ' , $ output ['items ' ][0 ]['properties ' ]['location ' ][0 ]['type ' ][0 ]);
1055+ }
1056+
1057+ /**
1058+ * @see https://github.com/microformats/php-mf2/issues/184
1059+ */
1060+ public function testVeventLocationProperty () {
1061+ // date fix, see: https://cpj.org/2012/10/cpj-impact-43/
1062+ // "second annual Online Press Freedom Summit in San Francisco on October 10"
1063+ $ input = '<div class="vevent">
1064+ <span class="summary">CPJ Online Press Freedom Summit</span>
1065+ (<time class="dtstart" datetime="2012-10-10">10 Oct 2012</time>) in
1066+ <span class="location">San Francisco</span>.
1067+ </div> ' ;
1068+ $ parser = new Parser ($ input , 'https://example.com ' );
1069+ $ output = $ parser ->parse ();
1070+
1071+ $ this ->assertArrayHasKey ('location ' , $ output ['items ' ][0 ]['properties ' ]);
1072+ $ this ->assertEquals ('San Francisco ' , $ output ['items ' ][0 ]['properties ' ]['location ' ][0 ]);
1073+ }
10081074}
10091075
0 commit comments