diff --git a/lib/XRay/Formats/Mf2.php b/lib/XRay/Formats/Mf2.php index 158dd2d..2d15acf 100644 --- a/lib/XRay/Formats/Mf2.php +++ b/lib/XRay/Formats/Mf2.php @@ -637,7 +637,7 @@ class Mf2 extends Format { $refs = []; // Single plaintext and URL values - self::collectSingleValues(['name','summary','published','start','end','duration'], ['url'], $item, $url, $data); + self::collectSingleValues(['name','summary','published','start','end','duration'], ['url','featured'], $item, $url, $data); // These properties are always returned as arrays and may contain plaintext content self::collectArrayValues(['category','location','attendee'], $item, $data, $refs, $http); diff --git a/tests/ParseTest.php b/tests/ParseTest.php index 226b807..0695ca0 100644 --- a/tests/ParseTest.php +++ b/tests/ParseTest.php @@ -586,6 +586,18 @@ class ParseTest extends PHPUnit_Framework_TestCase { $this->assertEquals('Venue', $data['data']['refs']['http://source.example.com/venue']['name']); } + public function testEventWithFeaturedImage() { + $url = 'http://source.example.com/h-event-featured'; + $response = $this->parse(['url' => $url]); + + $body = $response->getContent(); + $this->assertEquals(200, $response->getStatusCode()); + $data = json_decode($body, true); + $this->assertEquals('mf2+html', $data['source-format']); + $this->assertEquals('event', $data['data']['type']); + $this->assertEquals('http://source.example.com/featured.jpg', $data['data']['featured']); + } + public function testMf2ReviewOfProduct() { $url = 'http://source.example.com/h-review-of-product'; $response = $this->parse(['url' => $url]); diff --git a/tests/data/source.example.com/h-event-featured b/tests/data/source.example.com/h-event-featured new file mode 100644 index 0000000..1b9f517 --- /dev/null +++ b/tests/data/source.example.com/h-event-featured @@ -0,0 +1,26 @@ +HTTP/1.1 200 OK +Server: Apache +Date: Wed, 09 Dec 2015 03:29:14 GMT +Content-Type: text/html; charset=utf-8 +Connection: keep-alive + + +
+Are you building your own website? Indie reader? Personal publishing web app? Or some other digital magic-cloud proxy? If so, come on by and join a gathering of people with likeminded interests. Bring your friends that want to start a personal web site. Exchange information, swap ideas, talk shop, help work on a project...
+See the Homebrew Website Club Newsletter Volume 1 Issue 1 for a description of the first meeting.
+