From db780a9789f6e2ddd02df5704e99d00e4c95dd11 Mon Sep 17 00:00:00 2001 From: sebsel Date: Thu, 15 Nov 2018 23:28:44 +0100 Subject: [PATCH] create failing test: h-entry-with-h-card-before-it --- tests/ParseTest.php | 12 ++++++++++++ .../h-entry-with-h-card-before-it | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/data/source.example.com/h-entry-with-h-card-before-it 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 + + + + Test + + + Author Name +
+

Hello World

+ permalink +
+ +