Media: Use a filename instead of a URL in image header tests to avoid triggering an outbound HTTP request causing an ImageMagick exception on some configurations.

Props danielbachhuber.
Fixes #41216.

git-svn-id: https://develop.svn.wordpress.org/trunk@41017 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2017-07-07 00:06:36 +00:00
parent 50735b09f1
commit bb6e34a7fd
1 changed files with 3 additions and 3 deletions

View File

@ -111,11 +111,11 @@ class Tests_Image_Header extends WP_UnitTestCase {
'guid' => 'http://localhost/foo.png'
) );
$cropped = 'http://localhost/foo-cropped.png';
$cropped = 'foo-cropped.png';
$object = $this->custom_image_header->create_attachment_object( $cropped, $id );
$this->assertEquals( 'foo-cropped.png', $object['post_title'] );
$this->assertEquals( $cropped, $object['guid'] );
$this->assertEquals( 'http://localhost/' . $cropped, $object['guid'] );
$this->assertEquals( 'custom-header', $object['context'] );
$this->assertEquals( 'image/jpeg', $object['post_mime_type'] );
}
@ -128,7 +128,7 @@ class Tests_Image_Header extends WP_UnitTestCase {
'guid' => 'http://localhost/foo.png'
) );
$cropped = 'http://localhost/foo-cropped.png';
$cropped = 'foo-cropped.png';
$object = $this->custom_image_header->create_attachment_object( $cropped, $id );
$cropped_id = $this->custom_image_header->insert_attachment( $object, $cropped );