From d1c6dc9268ab2eeeec2a2ede212fbc5f1ffc11d6 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Mon, 29 Feb 2016 07:42:09 -0800 Subject: [PATCH] add a test for rsvp --- tests/ParseTest.php | 12 ++++++++++++ tests/data/source.example.com/h-entry-rsvp | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tests/data/source.example.com/h-entry-rsvp diff --git a/tests/ParseTest.php b/tests/ParseTest.php index bff8e27..f9cc794 100644 --- a/tests/ParseTest.php +++ b/tests/ParseTest.php @@ -190,4 +190,16 @@ class ParseTest extends PHPUnit_Framework_TestCase { $this->assertEquals('Hello World', $data['data']['content']['text']); } + public function testHEntryRSVP() { + $url = 'http://source.example.com/h-entry-rsvp'; + $response = $this->parse(['url' => $url]); + + $body = $response->getContent(); + $this->assertEquals(200, $response->getStatusCode()); + $data = json_decode($body, true); + $this->assertEquals('entry', $data['data']['type']); + $this->assertEquals('I\'ll be there!', $data['data']['name']); + $this->assertEquals('yes', $data['data']['rsvp']); + } + } diff --git a/tests/data/source.example.com/h-entry-rsvp b/tests/data/source.example.com/h-entry-rsvp new file mode 100644 index 0000000..edbe224 --- /dev/null +++ b/tests/data/source.example.com/h-entry-rsvp @@ -0,0 +1,16 @@ +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 + + +
+ I'll be there! +
+ +