Browse Source

add a test for rsvp

pull/39/head
Aaron Parecki 8 years ago
parent
commit
d1c6dc9268
2 changed files with 28 additions and 0 deletions
  1. +12
    -0
      tests/ParseTest.php
  2. +16
    -0
      tests/data/source.example.com/h-entry-rsvp

+ 12
- 0
tests/ParseTest.php View File

@ -190,4 +190,16 @@ class ParseTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('Hello World', $data['data']['content']['text']); $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']);
}
} }

+ 16
- 0
tests/data/source.example.com/h-entry-rsvp View File

@ -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
<html>
<head>
<title>Test</title>
</head>
<body>
<div class="h-entry">
<data class="p-rsvp" value="yes">I'll be there!</data>
</div>
</body>
</html>

Loading…
Cancel
Save