Skip to content

Commit

Permalink
add test with two h-cards before the h-entry
Browse files Browse the repository at this point in the history
  • Loading branch information
sebsel committed Nov 15, 2018
1 parent 1e638e7 commit fdbeb4f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/ParseTest.php
Expand Up @@ -460,6 +460,18 @@ public function testHEntryWithHCardSibling() {
$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]);
Expand Down
19 changes: 19 additions & 0 deletions 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

<html>
<head>
<title>Test</title>
</head>
<body>
<a href="/" class="h-card">Author Name</a>
<a href="http://example.com" class="h-card">Author Org</a>
<div class="h-entry">
<p class="p-content">Hello World</p>
<a href="/h-entry-with-two-h-cards-before-it">permalink</a>
</div>
</body>
</html>

0 comments on commit fdbeb4f

Please sign in to comment.