diff options
author | Andres Rey <[email protected]> | 2016-12-07 09:59:02 +0000 |
---|---|---|
committer | Andres Rey <[email protected]> | 2016-12-07 09:59:02 +0000 |
commit | 3ec5546359239f66714ae6eb5257810877202a52 (patch) | |
tree | f800888686b7fb0232a1c323600cfa11ba885c13 /src | |
parent | 0a8077f9e2a3f531a087b3ec5c07cf16ba5497ae (diff) |
Added some basic Unit Testing. HTML samples taken from readability.js
Diffstat (limited to 'src')
-rw-r--r-- | src/HTMLParser.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/HTMLParser.php b/src/HTMLParser.php index 7ebf97d..6705acd 100644 --- a/src/HTMLParser.php +++ b/src/HTMLParser.php @@ -138,9 +138,9 @@ class HTMLParser // Todo, fix return, check for values, maybe create a function to create the return object return [ - 'title' => $this->metadata['title'], - 'author' => $this->metadata['author'], - 'image' => $this->metadata['image'], + 'title' => isset($this->metadata['title']) ? $this->metadata['title'] : null, + 'author' => isset($this->metadata['author']) ? $this->metadata['author'] : null, + 'image' => isset($this->metadata['image']) ?$this->metadata['image'] : null, 'article' => $result, 'html' => $result->C14N() ]; |