diff --git a/tests/SanitizeTest.php b/tests/SanitizeTest.php
index 56851a7..62e499a 100644
--- a/tests/SanitizeTest.php
+++ b/tests/SanitizeTest.php
@@ -167,6 +167,18 @@ class SanitizeTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('This is a photo post with an img
tag inside the content.', $data->data->content->html);
}
+ public function testPhotoInTextContentNoAlt() {
+ // https://github.com/aaronpk/XRay/issues/56
+
+ $url = 'http://sanitize.example/photo-in-text-content';
+ $response = $this->parse(['url' => $url]);
+
+ $body = $response->getContent();
+ $this->assertEquals(200, $response->getStatusCode());
+ $data = json_decode($body);
+
+ echo json_encode($data, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
+
$this->assertObjectNotHasAttribute('name', $data->data);
$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);
diff --git a/tests/data/sanitize.example/photo-in-text-content b/tests/data/sanitize.example/photo-in-text-content
new file mode 100644
index 0000000..36dd2b2
--- /dev/null
+++ b/tests/data/sanitize.example/photo-in-text-content
@@ -0,0 +1,14 @@
+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
+
+
+
This is a photo post with an img
tag inside the content.