|
@ -177,8 +177,6 @@ class SanitizeTest extends PHPUnit_Framework_TestCase { |
|
|
$this->assertEquals(200, $response->getStatusCode()); |
|
|
$this->assertEquals(200, $response->getStatusCode()); |
|
|
$data = json_decode($body); |
|
|
$data = json_decode($body); |
|
|
|
|
|
|
|
|
echo json_encode($data, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES); |
|
|
|
|
|
|
|
|
|
|
|
$this->assertObjectNotHasAttribute('name', $data->data); |
|
|
$this->assertObjectNotHasAttribute('name', $data->data); |
|
|
$this->assertEquals('http://target.example.com/photo.jpg', $data->data->photo[0]); |
|
|
$this->assertEquals('http://target.example.com/photo.jpg', $data->data->photo[0]); |
|
|
$this->assertEquals('This is a photo post with an img tag inside the content.', $data->data->content->text); |
|
|
$this->assertEquals('This is a photo post with an img tag inside the content.', $data->data->content->text); |
|
@ -224,6 +222,22 @@ class SanitizeTest extends PHPUnit_Framework_TestCase { |
|
|
$body = $response->getContent(); |
|
|
$body = $response->getContent(); |
|
|
$this->assertEquals(200, $response->getStatusCode()); |
|
|
$this->assertEquals(200, $response->getStatusCode()); |
|
|
$data = json_decode($body); |
|
|
$data = json_decode($body); |
|
|
|
|
|
print_r($data); |
|
|
|
|
|
|
|
|
|
|
|
$this->assertObjectHasAttribute('name', $data->data); |
|
|
|
|
|
$this->assertEquals('Oh, how well they know me! 🥃', $data->data->name); |
|
|
|
|
|
$this->assertObjectNotHasAttribute('content', $data->data); |
|
|
|
|
|
$this->assertEquals('https://cleverdevil.io/file/5bf2fa91c3d4c592f9978200923cb56e/thumb.jpg', $data->data->photo[0]); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function testPhotoWithDupeNameAndAlt() { |
|
|
|
|
|
$url = 'http://sanitize.example/photo-with-dupe-name-alt'; |
|
|
|
|
|
$response = $this->parse(['url' => $url]); |
|
|
|
|
|
|
|
|
|
|
|
$body = $response->getContent(); |
|
|
|
|
|
$this->assertEquals(200, $response->getStatusCode()); |
|
|
|
|
|
$data = json_decode($body); |
|
|
|
|
|
echo json_encode($data->data, JSON_PRETTY_PRINT+JSON_UNESCAPED_SLASHES); |
|
|
|
|
|
|
|
|
$this->assertObjectHasAttribute('name', $data->data); |
|
|
$this->assertObjectHasAttribute('name', $data->data); |
|
|
$this->assertEquals('Oh, how well they know me! 🥃', $data->data->name); |
|
|
$this->assertEquals('Oh, how well they know me! 🥃', $data->data->name); |
|
|