Branch Coverage

blib/lib/Mojo/Weixin/Message/Remote/_upload_media.pm
Criterion Covered Total %
branch 0 142 0.0


line true false branch
12 0 0 unless (defined $msg and defined $msg->media_data || defined $msg->media_path)
21 0 0 if (defined $msg->media_data) { }
0 0 elsif ($msg->media_path =~ m[^https?://.*?([^/]+)$]) { }
23 0 0 unless defined $msg->media_ext
24 0 0 unless defined $msg->media_name
25 0 0 unless defined $msg->media_path
26 0 0 unless defined $msg->media_size
28 0 0 if ($msg->media_size > $max_media_size)
34 0 0 unless defined $msg->media_mime
35 0 0 unless defined $msg->media_mtime
42 0 0 if $name =~ /\.([^\.]+)$/
45 0 0 unless defined $body
48 0 0 unless ($ext)
49 0 0 $mime =~ m[^application/json]i ? :
0 0 $mime =~ m[^audio/mpeg]i ? :
0 0 $mime =~ m[^audio/mp3]i ? :
0 0 $mime =~ m[^video/mp4]i ? :
0 0 $mime =~ m[^application/json]i ? :
0 0 $mime =~ m[^text/json]i ? :
0 0 $mime =~ m[^text/html]i ? :
0 0 $mime =~ m[^text/plain]i ? :
0 0 $mime =~ m[^image/gif]i ? :
0 0 $mime =~ m[^image/bmp]i ? :
0 0 $mime =~ m[^image/png]i ? :
0 0 $mime =~ m[^image/jpe?g]i ? :
65 0 0 unless defined $msg->media_size
66 0 0 if ($msg->media_size > $max_media_size)
71 0 0 unless defined $msg->media_name
72 0 0 unless defined $msg->media_mime
73 0 0 unless defined $msg->media_mtime
74 0 0 unless defined $msg->media_data
75 0 0 unless defined $msg->media_ext
81 0 0 unless (-f $msg->media_path)
98 0 0 if ($size > $max_media_size)
107 0 0 if ($name =~ /\.($mime_reg)$/)
111 0 0 if $name =~ /\.([^\.]+)$/
112 0 0 unless $ext
114 0 0 unless defined $msg->media_name
115 0 0 unless defined $msg->media_size
116 0 0 unless defined $msg->media_mime
117 0 0 unless defined $msg->media_mtime
118 0 0 unless defined $msg->media_data
119 0 0 unless defined $msg->media_ext
122 0 0 if ($@)
133 0 0 if ($err)
139 0 0 if ($err) { }
0 0 elsif ($msg->media_chunk == $msg->media_chunks) { }
151 0 0 unless $msg->has_subscribers('_upload_media_chunk_over')
154 0 0 unless $msg->has_subscribers('_upload_media_chunk')
163 0 0 unless (defined $msg->media_chunks)
166 0 0 unless (defined $msg->media_clientid)
171 0 0 $msg->type eq 'group_message' ? :
187 0 0 if (not defined $msg->media_md5 and defined $msg->media_data)
188 0 0 if defined $msg->media_md5
190 0 0 unless (defined $msg->media_type)
191 0 0 $msg->media_mime =~ m[^image/] ? :
0 0 $msg->media_mime =~ m[^video/(mp4|mpeg)]i ? :
0 0 $msg->media_mime =~ m[^image/gif]i ? :
200 0 0 $msg->media_type eq 'file' ? :
0 0 $msg->media_type eq 'voicce' ? :
0 0 $msg->media_type eq 'microvideo' ? :
0 0 $msg->media_type eq 'video' ? :
0 0 $msg->media_type eq 'emoticon' ? :
0 0 $msg->media_type eq 'image' ? :
241 0 0 if (not defined $json) { }
247 0 0 defined $msg->media_code ? :
0 0 if $json->{'MediaId'}
252 0 0 $msg->media_chunks > 1 ? :
0 0 $msg->media_chunks > 1 ? :
0 0 $msg->media_type eq 'video' || $msg->media_type eq 'microvideo' ? :
0 0 $msg->media_type eq 'image' ? :