Skip to content

Commit e7f6b25

Browse files
authored
Merge pull request #256 from gRegorLove/dev/test-updates
Update tests
2 parents 103b34e + cff0bef commit e7f6b25

10 files changed

+220
-218
lines changed

tests/Mf2/ClassicMicroformatsTest.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* Contains tests of the classic microformat => µf2 functionality.
1717
*
18-
* Mainly based off BC tables on http://microformats.org/wiki/microformats2#v2_vocabularies
18+
* Mainly based off BC tables on https://microformats.org/wiki/microformats2#v2_vocabularies
1919
*/
2020
class ClassicMicroformatsTest extends TestCase {
2121
protected function set_up() {
@@ -152,7 +152,7 @@ public function test_vevent() {
152152
<div class="vevent">
153153
<h3 class="summary">XYZ Project Review</h3>
154154
<p class="description">Project XYZ Review Meeting</p>
155-
<p> <a class="url" href="http://example.com/xyz-meeting">http://example.com/xyz-meeting</a> </p>
155+
<p> <a class="url" href="https://example.com/xyz-meeting">https://example.com/xyz-meeting</a> </p>
156156
<p>To be held on
157157
<span class="dtstart">
158158
<abbr class="value" title="1998-03-12">the 12th of March</abbr>
@@ -181,7 +181,7 @@ public function test_vevent() {
181181

182182
$this->assertEquals('XYZ Project Review', $output['items'][0]['properties']['name'][0]);
183183
$this->assertEquals('Project XYZ Review Meeting', $output['items'][0]['properties']['description'][0]);
184-
$this->assertEquals('http://example.com/xyz-meeting', $output['items'][0]['properties']['url'][0]);
184+
$this->assertEquals('https://example.com/xyz-meeting', $output['items'][0]['properties']['url'][0]);
185185
$this->assertEquals('1998-03-12 08:30-0500', $output['items'][0]['properties']['start'][0]);
186186
$this->assertEquals('1998-03-12 09:30-0500', $output['items'][0]['properties']['end'][0]);
187187
}
@@ -255,7 +255,7 @@ public function testRelBookmarkUrl() {
255255

256256

257257
/**
258-
* @see http://microformats.org/wiki/microformats2-parsing-issues#any_h-_root_class_name_overrides_and_stops_backcompat_root
258+
* @see https://microformats.org/wiki/microformats2-parsing-issues#any_h-_root_class_name_overrides_and_stops_backcompat_root
259259
*/
260260
public function testMf2RootStopsBackcompatRoot() {
261261
$input = '<div class="adr h-adr">
@@ -273,7 +273,7 @@ public function testMf2RootStopsBackcompatRoot() {
273273

274274

275275
/**
276-
* @see http://microformats.org/wiki/microformats2-parsing-issues#any_h-_root_class_name_overrides_and_stops_backcompat_root
276+
* @see https://microformats.org/wiki/microformats2-parsing-issues#any_h-_root_class_name_overrides_and_stops_backcompat_root
277277
*/
278278
public function testMf2CustomRootStopsBackcompatRoot() {
279279
$input = '<div class="adr h-acme-address">
@@ -291,7 +291,7 @@ public function testMf2CustomRootStopsBackcompatRoot() {
291291

292292

293293
/**
294-
* @see http://microformats.org/wiki/microformats2-parsing-issues#uf2_children_on_backcompat_properties
294+
* @see https://microformats.org/wiki/microformats2-parsing-issues#uf2_children_on_backcompat_properties
295295
*/
296296
public function testMf2ChildrenOnBackcompatProperties() {
297297
$input = '<div class="vcard">
@@ -753,7 +753,7 @@ public function testMixedMf2andMf1Case4() {
753753

754754

755755
/**
756-
* @see http://microformats.org/wiki/hReview#Examples
756+
* @see https://microformats.org/wiki/hReview#Examples
757757
*/
758758
public function testParsesClassicHreview() {
759759
$input = <<< END
@@ -767,7 +767,7 @@ public function testParsesClassicHreview() {
767767
</div>
768768
<p>Visit date: <span>April 2005</span></p>
769769
<p>Food eaten: <span>Florentine crepe</span></p>
770-
<p>Permanent link for review: <a rel="self bookmark" href="http://example.com/crepe">http://example.com/crepe</a></p>
770+
<p>Permanent link for review: <a rel="self bookmark" href="https://example.com/crepe">https://example.com/crepe</a></p>
771771
</div>
772772
END;
773773
$parser = new Parser($input);

tests/Mf2/CombinedMicroformatsTest.php

+25-23
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Combined Microformats Test
1212
*
1313
* 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
1515
*
1616
* @todo implement
1717
*/
@@ -23,18 +23,20 @@ protected function set_up() {
2323
}
2424

2525
/**
26-
* From http://microformats.org/wiki/microformats2#combining_microformats
26+
* From https://microformats.org/wiki/microformats2#combining_microformats
2727
*/
2828
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
2931
$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">
3133
IndieWebCamp 2012
3234
</a>
3335
from <time class="dt-start">2012-06-30</time>
3436
to <time class="dt-end">2012-07-01</time> at
3537
<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>
3840
</span>
3941
</div>';
4042
$expected = '{
@@ -44,17 +46,17 @@ public function testHEventLocationHCard() {
4446
"type": ["h-event"],
4547
"properties": {
4648
"name": ["IndieWebCamp 2012"],
47-
"url": ["http://indiewebcamp.com/2012"],
49+
"url": ["https://indieweb.org/2012"],
4850
"start": ["2012-06-30"],
4951
"end": ["2012-07-01"],
5052
"location": [{
51-
"value": "Geoloqi",
53+
"value": "Powell’s",
5254
"type": ["h-card"],
5355
"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."],
5860
"locality": ["Portland"],
5961
"region": ["Oregon"]
6062
}
@@ -71,7 +73,7 @@ public function testHEventLocationHCard() {
7173
}
7274

7375
/**
74-
* From http://microformats.org/wiki/microformats2#combining_microformats
76+
* From https://microformats.org/wiki/microformats2#combining_microformats
7577
*/
7678
public function testHCardOrgPOrg() {
7779
$input = '<div class="h-card">
@@ -101,7 +103,7 @@ public function testHCardOrgPOrg() {
101103
}
102104

103105
/**
104-
* From http://microformats.org/wiki/microformats2#combining_microformats
106+
* From https://microformats.org/wiki/microformats2#combining_microformats
105107
*/
106108
public function testHCardOrgHCard() {
107109
$input = '<div class="h-card">
@@ -140,7 +142,7 @@ public function testHCardOrgHCard() {
140142
}
141143

142144
/**
143-
* From http://microformats.org/wiki/microformats2#combining_microformats
145+
* From https://microformats.org/wiki/microformats2#combining_microformats
144146
*/
145147
public function testHCardPOrgHCardHOrg() {
146148
$input = '<div class="h-card">
@@ -178,7 +180,7 @@ public function testHCardPOrgHCardHOrg() {
178180
}
179181

180182
/**
181-
* From http://microformats.org/wiki/microformats2#combining_microformats
183+
* From https://microformats.org/wiki/microformats2#combining_microformats
182184
*/
183185
public function testHCardChildHCard() {
184186
$input = '<div class="h-card">
@@ -257,9 +259,9 @@ public function testMicroformatsNestedUnderUPropertyClassnamesDeriveValueFromURL
257259
<p class="e-content">Hello World</p>
258260
<ul>
259261
<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>
261263
<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>
263265
</li>
264266
</ul>
265267
</div>';
@@ -279,16 +281,16 @@ public function testMicroformatsNestedUnderUPropertyClassnamesDeriveValueFromURL
279281
"type": ["h-card"],
280282
"properties": {
281283
"name": ["Jane Bloggs"],
282-
"url": ["http:\/\/jane.example.com\/"]
284+
"url": ["https:\/\/jane.example.com\/"]
283285
},
284-
"value": "http:\/\/jane.example.com\/"
286+
"value": "https:\/\/jane.example.com\/"
285287
}],
286288
"content": ["lol"],
287289
"name": ["lol"],
288-
"url": ["http:\/\/example.org\/post1234"],
290+
"url": ["https:\/\/example.com\/post1234"],
289291
"published": ["2015-07-12 12:03"]
290292
},
291-
"value": "http:\/\/example.org\/post1234"
293+
"value": "https:\/\/example.com\/post1234"
292294
}]
293295
}
294296
}],
@@ -298,8 +300,8 @@ public function testMicroformatsNestedUnderUPropertyClassnamesDeriveValueFromURL
298300
$mf = Mf2\parse($input);
299301

300302
$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/');
303305
}
304306

305307
public function testMicroformatsNestedUnderPPropertyClassnamesDeriveValueFromFirstPName() {

tests/Mf2/MicroformatsWikiExamplesTest.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function testHandlesNullCorrectly() {
5454
}
5555

5656
/**
57-
* From http://microformats.org/wiki/microformats-2
57+
* From https://microformats.org/wiki/microformats-2
5858
*/
5959
public function testSimplePersonReference() {
6060
$input = '<span class="h-card">Frances Berriman</span>';
@@ -75,7 +75,7 @@ public function testSimplePersonReference() {
7575
}
7676

7777
/**
78-
* From http://microformats.org/wiki/microformats-2
78+
* From https://microformats.org/wiki/microformats-2
7979
*/
8080
public function testSimpleHyperlinkedPersonReference() {
8181
$input = '<a class="h-card" href="http://benward.me">Ben Ward</a>';
@@ -97,10 +97,10 @@ public function testSimpleHyperlinkedPersonReference() {
9797
}
9898

9999
/**
100-
* From http://microformats.org/wiki/microformats-2-implied-properties
100+
* From https://microformats.org/wiki/microformats-2-implied-properties
101101
*/
102102
public function testSimplePersonImage() {
103-
$input = '<img class="h-card" src="http://example.org/pic.jpg" alt="Chris Messina" />';
103+
$input = '<img class="h-card" src="http://example.com/pic.jpg" alt="Chris Messina" />';
104104
// Added root items key
105105
$expected = '{
106106
"rels": {},
@@ -110,7 +110,7 @@ public function testSimplePersonImage() {
110110
"properties": {
111111
"name": ["Chris Messina"],
112112
"photo": [{
113-
"value": "http://example.org/pic.jpg",
113+
"value": "http://example.com/pic.jpg",
114114
"alt": "Chris Messina"
115115
}]
116116
}
@@ -122,7 +122,7 @@ public function testSimplePersonImage() {
122122
}
123123

124124
/**
125-
* From http://microformats.org/wiki/microformats-2-implied-properties
125+
* From https://microformats.org/wiki/microformats-2-implied-properties
126126
*/
127127
public function testHyperlinkedImageNameAndPhotoProperties() {
128128
$input = '<a class="h-card" href="http://rohit.khare.org/">
@@ -151,7 +151,7 @@ public function testHyperlinkedImageNameAndPhotoProperties() {
151151
}
152152

153153
/**
154-
* From http://microformats.org/wiki/microformats-2
154+
* From https://microformats.org/wiki/microformats-2
155155
*/
156156
public function testMoreDetailedPerson() {
157157
$input = '<div class="h-card">

tests/Mf2/ParseDTTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ public function testDTStartDateOnly() {
297297
/**
298298
* TZ offsets normalized only for VCP.
299299
* This behavior is implied from "However the colons ":" separating the hours and minutes of any timezone offset are optional and discouraged in order to make it less likely that a timezone offset will be confused for a time."
300-
* @see http://microformats.org/wiki/index.php?title=value-class-pattern&oldid=66473##However+the+colons
300+
* @see https://microformats.org/wiki/index.php?title=value-class-pattern&oldid=66473##However+the+colons
301301
*/
302302
public function testNormalizeTZOffsetVCP() {
303303
$input = '<div class="h-event">

0 commit comments

Comments
 (0)