11
11
* Combined Microformats Test
12
12
*
13
13
* Tests the ability of Parser::parse() to handle nested microformats correctly.
14
- * More info at http ://microformats.org/wiki/microformats-2#combining_microformats
14
+ * More info at https ://microformats.org/wiki/microformats-2#combining_microformats
15
15
*
16
16
* @todo implement
17
17
*/
@@ -23,18 +23,20 @@ protected function set_up() {
23
23
}
24
24
25
25
/**
26
- * From http ://microformats.org/wiki/microformats2#combining_microformats
26
+ * From https ://microformats.org/wiki/microformats2#combining_microformats
27
27
*/
28
28
public function testHEventLocationHCard () {
29
+ // Note: The venue for IWC 2012 no longer exists so we switched
30
+ // this to Powell's since it's a long-term Portland institution
29
31
$ input = '<div class="h-event">
30
- <a class="p-name u-url" href="http ://indiewebcamp.com /2012">
32
+ <a class="p-name u-url" href="https ://indieweb.org /2012">
31
33
IndieWebCamp 2012
32
34
</a>
33
35
from <time class="dt-start">2012-06-30</time>
34
36
to <time class="dt-end">2012-07-01</time> at
35
37
<span class="p-location h-card">
36
- <a class="p-name p-org u-url" href="http ://geoloqi .com/">
37
- Geoloqi </a>, <span class="p-street-address">920 SW 3rd Ave. Suite 400 </span>, <span class="p-locality">Portland</span>, <abbr class="p-region" title="Oregon">OR</abbr>
38
+ <a class="p-name p-org u-url" href="https ://www.powells .com/">
39
+ Powell’s </a>, <span class="p-street-address">1005 W Burnside St. </span>, <span class="p-locality">Portland</span>, <abbr class="p-region" title="Oregon">OR</abbr>
38
40
</span>
39
41
</div> ' ;
40
42
$ expected = '{
@@ -44,17 +46,17 @@ public function testHEventLocationHCard() {
44
46
"type": ["h-event"],
45
47
"properties": {
46
48
"name": ["IndieWebCamp 2012"],
47
- "url": ["http ://indiewebcamp.com /2012"],
49
+ "url": ["https ://indieweb.org /2012"],
48
50
"start": ["2012-06-30"],
49
51
"end": ["2012-07-01"],
50
52
"location": [{
51
- "value": "Geoloqi ",
53
+ "value": "Powell’s ",
52
54
"type": ["h-card"],
53
55
"properties": {
54
- "name": ["Geoloqi "],
55
- "org": ["Geoloqi "],
56
- "url": ["http ://geoloqi .com/"],
57
- "street-address": ["920 SW 3rd Ave. Suite 400 "],
56
+ "name": ["Powell’s "],
57
+ "org": ["Powell’s "],
58
+ "url": ["https ://www.powells .com/"],
59
+ "street-address": ["1005 W Burnside St. "],
58
60
"locality": ["Portland"],
59
61
"region": ["Oregon"]
60
62
}
@@ -71,7 +73,7 @@ public function testHEventLocationHCard() {
71
73
}
72
74
73
75
/**
74
- * From http ://microformats.org/wiki/microformats2#combining_microformats
76
+ * From https ://microformats.org/wiki/microformats2#combining_microformats
75
77
*/
76
78
public function testHCardOrgPOrg () {
77
79
$ input = '<div class="h-card">
@@ -101,7 +103,7 @@ public function testHCardOrgPOrg() {
101
103
}
102
104
103
105
/**
104
- * From http ://microformats.org/wiki/microformats2#combining_microformats
106
+ * From https ://microformats.org/wiki/microformats2#combining_microformats
105
107
*/
106
108
public function testHCardOrgHCard () {
107
109
$ input = '<div class="h-card">
@@ -140,7 +142,7 @@ public function testHCardOrgHCard() {
140
142
}
141
143
142
144
/**
143
- * From http ://microformats.org/wiki/microformats2#combining_microformats
145
+ * From https ://microformats.org/wiki/microformats2#combining_microformats
144
146
*/
145
147
public function testHCardPOrgHCardHOrg () {
146
148
$ input = '<div class="h-card">
@@ -178,7 +180,7 @@ public function testHCardPOrgHCardHOrg() {
178
180
}
179
181
180
182
/**
181
- * From http ://microformats.org/wiki/microformats2#combining_microformats
183
+ * From https ://microformats.org/wiki/microformats2#combining_microformats
182
184
*/
183
185
public function testHCardChildHCard () {
184
186
$ input = '<div class="h-card">
@@ -257,9 +259,9 @@ public function testMicroformatsNestedUnderUPropertyClassnamesDeriveValueFromURL
257
259
<p class="e-content">Hello World</p>
258
260
<ul>
259
261
<li class="u-comment h-cite">
260
- <a class="u-author h-card" href="http ://jane.example.com/">Jane Bloggs</a>
262
+ <a class="u-author h-card" href="https ://jane.example.com/">Jane Bloggs</a>
261
263
<p class="p-content p-name">lol</p>
262
- <a class="u-url" href="http ://example.org /post1234"><time class="dt-published">2015-07-12 12:03</time></a>
264
+ <a class="u-url" href="https ://example.com /post1234"><time class="dt-published">2015-07-12 12:03</time></a>
263
265
</li>
264
266
</ul>
265
267
</div> ' ;
@@ -279,16 +281,16 @@ public function testMicroformatsNestedUnderUPropertyClassnamesDeriveValueFromURL
279
281
"type": ["h-card"],
280
282
"properties": {
281
283
"name": ["Jane Bloggs"],
282
- "url": ["http :\/\/jane.example.com\/"]
284
+ "url": ["https :\/\/jane.example.com\/"]
283
285
},
284
- "value": "http :\/\/jane.example.com\/"
286
+ "value": "https :\/\/jane.example.com\/"
285
287
}],
286
288
"content": ["lol"],
287
289
"name": ["lol"],
288
- "url": ["http :\/\/example.org \/post1234"],
290
+ "url": ["https :\/\/example.com \/post1234"],
289
291
"published": ["2015-07-12 12:03"]
290
292
},
291
- "value": "http :\/\/example.org \/post1234"
293
+ "value": "https :\/\/example.com \/post1234"
292
294
}]
293
295
}
294
296
}],
@@ -298,8 +300,8 @@ public function testMicroformatsNestedUnderUPropertyClassnamesDeriveValueFromURL
298
300
$ mf = Mf2 \parse ($ input );
299
301
300
302
$ this ->assertJsonStringEqualsJsonString (json_encode ($ mf ), $ expected );
301
- $ this ->assertEquals ($ mf ['items ' ][0 ]['properties ' ]['comment ' ][0 ]['value ' ], 'http ://example.org /post1234 ' );
302
- $ this ->assertEquals ($ mf ['items ' ][0 ]['properties ' ]['comment ' ][0 ]['properties ' ]['author ' ][0 ]['value ' ], 'http ://jane.example.com/ ' );
303
+ $ this ->assertEquals ($ mf ['items ' ][0 ]['properties ' ]['comment ' ][0 ]['value ' ], 'https ://example.com /post1234 ' );
304
+ $ this ->assertEquals ($ mf ['items ' ][0 ]['properties ' ]['comment ' ][0 ]['properties ' ]['author ' ][0 ]['value ' ], 'https ://jane.example.com/ ' );
303
305
}
304
306
305
307
public function testMicroformatsNestedUnderPPropertyClassnamesDeriveValueFromFirstPName () {
0 commit comments