From 2d52b982cb9cb085389c428072e787370abb757a Mon Sep 17 00:00:00 2001
From: Aaron Parecki
Date: Wed, 2 Mar 2016 16:59:33 -0800
Subject: [PATCH] fix test data
---
tests/ParseTest.php | 11 +++++++++++
.../h-entry-author-is-url-to-h-card-on-page | 1 +
...y-author-is-url-to-h-card-with-multiple-links | 1 +
.../h-entry-has-h-card-and-url-author | 3 ++-
.../single-h-entry-has-no-permalink | 16 ++++++++++++++++
5 files changed, 31 insertions(+), 1 deletion(-)
create mode 100644 tests/data/source.example.com/single-h-entry-has-no-permalink
diff --git a/tests/ParseTest.php b/tests/ParseTest.php
index 5714dd5..9104cdb 100644
--- a/tests/ParseTest.php
+++ b/tests/ParseTest.php
@@ -235,4 +235,15 @@ class ParseTest extends PHPUnit_Framework_TestCase {
$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']);
+ }
+
}
diff --git a/tests/data/author.example.com/h-entry-author-is-url-to-h-card-on-page b/tests/data/author.example.com/h-entry-author-is-url-to-h-card-on-page
index fd61e9d..a932372 100644
--- a/tests/data/author.example.com/h-entry-author-is-url-to-h-card-on-page
+++ b/tests/data/author.example.com/h-entry-author-is-url-to-h-card-on-page
@@ -14,6 +14,7 @@ Content-Type: text/html; charset=utf-8
Hello World
Author
+
permalink
diff --git a/tests/data/author.example.com/h-entry-author-is-url-to-h-card-with-multiple-links b/tests/data/author.example.com/h-entry-author-is-url-to-h-card-with-multiple-links
index de6a124..4862f76 100644
--- a/tests/data/author.example.com/h-entry-author-is-url-to-h-card-with-multiple-links
+++ b/tests/data/author.example.com/h-entry-author-is-url-to-h-card-with-multiple-links
@@ -14,6 +14,7 @@ Content-Type: text/html; charset=utf-8
Author
Hello World
+
permalink
+
+
diff --git a/tests/data/author.example.com/h-entry-has-h-card-and-url-author b/tests/data/author.example.com/h-entry-has-h-card-and-url-author
index 28dbeb0..21fc7e1 100644
--- a/tests/data/author.example.com/h-entry-has-h-card-and-url-author
+++ b/tests/data/author.example.com/h-entry-has-h-card-and-url-author
@@ -23,7 +23,8 @@ Content-Type: text/html; charset=utf-8
Hello World
-
+
+ permalink
diff --git a/tests/data/source.example.com/single-h-entry-has-no-permalink b/tests/data/source.example.com/single-h-entry-has-no-permalink
new file mode 100644
index 0000000..9584094
--- /dev/null
+++ b/tests/data/source.example.com/single-h-entry-has-no-permalink
@@ -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
+
+
+