From fdbeb4fdc1fd8b320f0508f03055c60b0ecbe91e Mon Sep 17 00:00:00 2001 From: sebsel Date: Thu, 15 Nov 2018 23:43:13 +0100 Subject: [PATCH] add test with two h-cards before the h-entry --- tests/ParseTest.php | 12 ++++++++++++ .../h-entry-with-two-h-cards-before-it | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 tests/data/source.example.com/h-entry-with-two-h-cards-before-it diff --git a/tests/ParseTest.php b/tests/ParseTest.php index 6365487..226b807 100644 --- a/tests/ParseTest.php +++ b/tests/ParseTest.php @@ -460,6 +460,18 @@ class ParseTest extends PHPUnit_Framework_TestCase { $this->assertEquals('Hello World', $data['data']['content']['text']); } + public function testHEntryWithTwoHCardsBeforeIt() { + $url = 'http://source.example.com/h-entry-with-two-h-cards-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 testHEntryRedirectWithHCardSibling() { $url = 'http://source.example.com/h-entry-redirect-with-h-card-sibling'; $response = $this->parse(['url' => $url]); diff --git a/tests/data/source.example.com/h-entry-with-two-h-cards-before-it b/tests/data/source.example.com/h-entry-with-two-h-cards-before-it new file mode 100644 index 0000000..e73f91c --- /dev/null +++ b/tests/data/source.example.com/h-entry-with-two-h-cards-before-it @@ -0,0 +1,19 @@ +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 + + + + Test + + + Author Name + Author Org +
+

Hello World

+ permalink +
+ +