public static function get_image_attachment($pid = 0, $file = 'arch.jpg')
{
$filename = self::copyTestImage($file);
$filetype = wp_check_filetype(basename($filename), null);
$attachment = array('post_title' => 'The Arch', 'post_content' => '', 'post_mime_type' => $filetype['type']);
$iid = wp_insert_attachment($attachment, $filename, $pid);
return $iid;
}