Browse Source

create failing test: h-entry-with-h-card-before-it

pull/83/head
sebsel 6 years ago
parent
commit
db780a9789
2 changed files with 30 additions and 0 deletions
  1. +12
    -0
      tests/ParseTest.php
  2. +18
    -0
      tests/data/source.example.com/h-entry-with-h-card-before-it

+ 12
- 0
tests/ParseTest.php View File

@ -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]);

+ 18
- 0
tests/data/source.example.com/h-entry-with-h-card-before-it View File

@ -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
<html>
<head>
<title>Test</title>
</head>
<body>
<a href="/" class="h-card">Author Name</a>
<div class="h-entry">
<p class="p-content">Hello World</p>
<a href="/h-entry-with-h-card-before-it">permalink</a>
</div>
</body>
</html>

Loading…
Cancel
Save