File Coverage

blib/lib/Mojo/Webqq/Model/Remote/_set_group_member_card.pm
Criterion Covered Total %
statement 3 11 27.2
branch 0 6 0.0
condition n/a
subroutine 1 2 50.0
pod n/a
total 4 19 21.0


line stmt bran cond sub pod time code
1 1     1   8 use strict;
  1         3  
  1         140  
2             sub Mojo::Webqq::Model::_set_group_member_card{
3 0     0     my $self = shift;
4 0           my($uid,$qq,$card) = @_;
5 0           my $api = "http://qinfo.clt.qq.com/cgi-bin/qun_info/set_group_card";
6 0 0         my $form = length $card?{gc=>$uid,u=>$qq,name=>$card,bkn=>$self->get_csrf_token}:{gc=>$uid,u=>$qq,bkn=>$self->get_csrf_token};
7 0           my $json = $self->http_post($api,{Referer=>"http://qinfo.clt.qq.com/member.html",json=>1},form=>$form);
8 0 0         return if not defined $json;
9 0 0         return if $json->{ec}!=0;
10 0           return 1;
11             }
12             1;