from_attachment() 정적인 공개 메소드

Get attachment images for a specified post and return them. Also make sure their dimensions are at or above a required minimum.
static public from_attachment ( $post_id, $width = 200, $height = 200 )
 /**
  * @author scotchfield
  * @covers Jetpack_PostImages::from_attachment
  * @since 3.2
  */
 public function test_from_attachment_is_correct_array()
 {
     $img_name = 'image.jpg';
     $img_url = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . $img_name;
     $img_html = '<img src="' . $img_url . '"/>';
     $img_dimensions = array('width' => 250, 'height' => 250);
     $post_id = $this->factory->post->create(array('post_content' => $img_html));
     $attachment_id = $this->factory->attachment->create_object($img_name, $post_id, array('post_mime_type' => 'image/jpeg', 'post_type' => 'attachment'));
     wp_update_attachment_metadata($attachment_id, $img_dimensions);
     $images = Jetpack_PostImages::from_attachment($post_id);
     $this->assertEquals(count($images), 1);
     $this->assertEquals($images[0]['src'], $img_url);
 }