Browse Source

fix test data

pull/39/head
Aaron Parecki 8 years ago
parent
commit
2d52b982cb
5 changed files with 31 additions and 1 deletions
  1. +11
    -0
      tests/ParseTest.php
  2. +1
    -0
      tests/data/author.example.com/h-entry-author-is-url-to-h-card-on-page
  3. +1
    -0
      tests/data/author.example.com/h-entry-author-is-url-to-h-card-with-multiple-links
  4. +2
    -1
      tests/data/author.example.com/h-entry-has-h-card-and-url-author
  5. +16
    -0
      tests/data/source.example.com/single-h-entry-has-no-permalink

+ 11
- 0
tests/ParseTest.php View File

@ -235,4 +235,15 @@ class ParseTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('Hello World', $data['data']['content']['text']); $this->assertEquals('Hello World', $data['data']['content']['text']);
} }
public function testSingleHEntryHasNoPermalink() {
$url = 'http://source.example.com/single-h-entry-has-no-permalink';
$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('Hello World', $data['data']['content']['text']);
}
} }

+ 1
- 0
tests/data/author.example.com/h-entry-author-is-url-to-h-card-on-page View File

@ -14,6 +14,7 @@ Content-Type: text/html; charset=utf-8
<div class="h-entry"> <div class="h-entry">
<p class="p-name e-content">Hello World</p> <p class="p-name e-content">Hello World</p>
<a href="/about" class="u-author">Author</a> <a href="/about" class="u-author">Author</a>
<a href="/h-entry-author-is-url-to-h-card-on-page" class="u-url">permalink</a>
</div> </div>
<div class="h-card"> <div class="h-card">

+ 1
- 0
tests/data/author.example.com/h-entry-author-is-url-to-h-card-with-multiple-links View File

@ -14,6 +14,7 @@ Content-Type: text/html; charset=utf-8
<div class="h-entry"> <div class="h-entry">
<a href="/about-with-multiple-urls" class="u-author">Author</a> <a href="/about-with-multiple-urls" class="u-author">Author</a>
<p class="p-name e-content">Hello World</p> <p class="p-name e-content">Hello World</p>
<a href="/h-entry-author-is-url-to-h-card-with-multiple-links" class="u-url">permalink</a>
</div> </div>
</body> </body>

+ 2
- 1
tests/data/author.example.com/h-entry-has-h-card-and-url-author View File

@ -23,7 +23,8 @@ Content-Type: text/html; charset=utf-8
</div> </div>
<p class="p-name e-content">Hello World</p> <p class="p-name e-content">Hello World</p>
<a href="/h-entry-has-h-card-and-url-author" class="u-url">permalink</a>
</div> </div>
</body> </body>

+ 16
- 0
tests/data/source.example.com/single-h-entry-has-no-permalink 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">
<p class="p-content">Hello World</p>
</div>
</body>
</html>

Loading…
Cancel
Save