Browse Source

Expand h-feed v1 support per test

master
J. King 1 year ago
parent
commit
cbe54dc1c5
  1. 10
      lib/Parser.php
  2. 5
      tests/cases/StandardTest.php

10
lib/Parser.php

@ -37,7 +37,7 @@ class Parser {
'additional-name' => ['h-card' => ["p", "additional-name"]],
'adr' => ['h-card' => ["p", "adr"]],
'affiliation' => ['h-resume' => ["p", "affiliation", ["vcard"]]],
'author' => ['h-entry' => ["p", "author", ["vcard"]], 'h-recipe' => ["p", "author", ["vcard"]]],
'author' => ['h-entry' => ["p", "author", ["vcard"]], 'h-recipe' => ["p", "author", ["vcard"]], 'h-feed' => ["p", "author", ["vcard"]]],
'bday' => ['h-card' => ["dt", "bday"]],
'best' => ['h-review' => ["p", "best"], 'h-review-aggregate' => ["p", "best"]],
'brand' => ['h-product' => ["p", "brand"]],
@ -53,7 +53,7 @@ class Parser {
'duration' => ['h-event' => ["dt", "duration"], 'h-recipe' => ["dt", "duration"]],
'education' => ['h-resume' => ["p", "education", ["vevent"]]],
'email' => ['h-card' => ["u", "email"]],
'entry' => ['h-feed' => ["p", "entry"], 'h-news' => ["p", "entry"]],
'entry' => ['h-news' => ["p", "entry"]],
'entry-content' => ['h-entry' => ["e", "content"]],
'entry-date' => ['h-entry' => ["dt", "published", [], null, true]], // also requires special processing
'entry-summary' => ['h-entry' => ["p", "summary"]],
@ -62,7 +62,7 @@ class Parser {
'extended-address' => ['h-adr' => ["p", "extended-address"], 'h-card' => ["p", "extended-address"]],
'family-name' => ['h-card' => ["p", "family-name"]],
'fn' => ['h-card' => ["p", "name"], 'h-product' => ["p", "name"], 'h-recipe' => ["p", "name"], 'h-review' => ["p", "name", [], "item"], 'h-review-aggregate' => ["p", "name", [], "item"]],
'geo' => ['h-card' => ["p", "geo"], 'h-event' => ["p", "geo"], 'h-news' => ["p", "geo", ["geo"]]],
'geo' => ['h-card' => ["p", "geo"], 'h-event' => ["p", "geo"], 'h-news' => ["p", "geo"]],
'given-name' => ['h-card' => ["p", "given-name"]],
'honorific-prefix' => ['h-card' => ["p", "honorific-prefix"]],
'honorific-suffix' => ['h-card' => ["p", "honorific-suffix"]],
@ -82,7 +82,7 @@ class Parser {
'organization-name' => ['h-card' => ["p", "organization-name"]],
'organization-unit' => ['h-card' => ["p", "organization-unit"]],
'org' => ['h-card' => ["p", "org"]],
'photo' => ['h-card' => ["u", "photo"], 'h-product' => ["u", "photo"], 'h-recipe' => ["u", "photo"], 'h-review' => ["u", "photo", [], "item"], 'h-review-aggregate' => ["u", "photo", [], "item"]],
'photo' => ['h-card' => ["u", "photo"], 'h-product' => ["u", "photo"], 'h-recipe' => ["u", "photo"], 'h-review' => ["u", "photo", [], "item"], 'h-review-aggregate' => ["u", "photo", [], "item"], 'h-feed' => ["u", "photo"]],
'postal-code' => ['h-adr' => ["p", "postal-code"], 'h-card' => ["p", "postal-code"]],
'post-office-box' => ['h-adr' => ["p", "post-office-box"], 'h-card' => ["p", "post-office-box"]],
'price' => ['h-product' => ["p", "price"]],
@ -104,7 +104,7 @@ class Parser {
'tz' => ['h-card' => ["p", "tz"]],
'uid' => ['h-card' => ["u", "uid"]],
'updated' => ['h-entry' => ["dt", "updated"]],
'url' => ['h-card' => ["u", "url"], 'h-event' => ["u", "url"], 'h-product' => ["u", "url"], 'h-review' => ["u", "url", [], "item"], 'h-review-aggregate' => ["u", "url", [], "item"]],
'url' => ['h-card' => ["u", "url"], 'h-event' => ["u", "url"], 'h-product' => ["u", "url"], 'h-review' => ["u", "url", [], "item"], 'h-review-aggregate' => ["u", "url", [], "item"], 'h-feed' => ["u", "url"]],
'votes' => ['h-review-aggregate' => ["p", "votes"]],
'worst' => ['h-review' => ["p", "worst"], 'h-review-aggregate' => ["p", "worst"]],
'yield' => ['h-recipe' => ["p", "yield"]],

5
tests/cases/StandardTest.php

@ -20,7 +20,6 @@ class StandardTest extends \PHPUnit\Framework\TestCase {
"microformats-v1/hcard/multiple",
"microformats-v1/hcard/name",
"microformats-v1/hcard/single",
"microformats-v1/hfeed/simple",
"microformats-v1/hproduct/aggregate",
"microformats-v1/hresume/affiliation",
"microformats-v1/hresume/education",
@ -99,6 +98,10 @@ class StandardTest extends \PHPUnit\Framework\TestCase {
case "microformats-v1/hnews/minimum":
case "microformats-v1/hnews/all":
$this->fixDates($exp['items'][0]['properties']['entry'][0]['properties']['updated']);
break;
case "microformats-v1/hfeed/simple":
$this->fixDates($exp['items'][0]['children'][0]['properties']['updated']);
break;
}
return $exp;
}

Loading…
Cancel
Save