diff --git a/controllers/Parse.php b/controllers/Parse.php index 1dc5322..eebe12a 100644 --- a/controllers/Parse.php +++ b/controllers/Parse.php @@ -221,7 +221,9 @@ class Parse { if(!$found) { return $this->respond($response, 200, [ 'error' => 'no_link_found', - 'error_description' => 'The source document does not have a link to the target URL' + 'error_description' => 'The source document does not have a link to the target URL', + 'url' => $result['url'], + 'code' => $result['code'], ]); } } diff --git a/tests/ParseTest.php b/tests/ParseTest.php index 534f328..8dead17 100644 --- a/tests/ParseTest.php +++ b/tests/ParseTest.php @@ -48,6 +48,8 @@ class ParseTest extends PHPUnit_Framework_TestCase { $data = json_decode($body); $this->assertObjectHasAttribute('error', $data); $this->assertEquals('no_link_found', $data->error); + $this->assertEquals('200', $data->code); + $this->assertEquals($url, $data->url); } public function testTargetFound() { @@ -58,7 +60,6 @@ class ParseTest extends PHPUnit_Framework_TestCase { $this->assertEquals(200, $response->getStatusCode()); $data = json_decode($body); $this->assertObjectNotHasAttribute('error', $data); - $this->assertObjectNotHasAttribute('error', $data); } public function testHTMLContent() {