diff --git a/tests/ParseTest.php b/tests/ParseTest.php index 86d5380..6365487 100644 --- a/tests/ParseTest.php +++ b/tests/ParseTest.php @@ -436,6 +436,18 @@ class ParseTest extends PHPUnit_Framework_TestCase { $this->assertEquals('Primary Post', $data['data']['name']); } + public function testHEntryWithHCardBeforeIt() { + $url = 'http://source.example.com/h-entry-with-h-card-before-it'; + $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('entry', $data['data']['type']); + $this->assertEquals('Hello World', $data['data']['content']['text']); + } + public function testHEntryWithHCardSibling() { $url = 'http://source.example.com/h-entry-with-h-card-sibling'; $response = $this->parse(['url' => $url]); diff --git a/tests/data/source.example.com/h-entry-with-h-card-before-it b/tests/data/source.example.com/h-entry-with-h-card-before-it new file mode 100644 index 0000000..01e5ea3 --- /dev/null +++ b/tests/data/source.example.com/h-entry-with-h-card-before-it @@ -0,0 +1,18 @@ +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 + + +
+Hello World
+ permalink +