Branch Coverage

blib/lib/Metabrik/Client/Www.pm
Criterion Covered Total %
branch 0 182 0.0


line true false branch
122 0 0 $self->ssl_verify ? :
141 0 0 if ($self->do_javascript)
142 0 0 if ($self->brik_has_module('WWW::Mechanize::PhantomJS') and $self->brik_has_binary('phantomjs')) { }
150 0 0 if (not $self->do_redirects and $mechanize eq 'WWW::Mechanize::PhantomJS') { }
0 0 elsif ($self->do_redirects) { }
162 0 0 if (defined $src_ip)
163 0 0 unless my $na = "Metabrik::Network::Address"->new_from_brik_init($self)
164 0 0 unless ($na->is_ip($src_ip))
171 0 0 unless (defined $mech)
175 0 0 if ($self->user_agent) { }
180 0 0 if ($mech->can("agent_alias"))
185 0 0 defined $username ? :
186 0 0 defined $password ? :
187 0 0 if (defined $username and defined $password)
193 0 0 if ($self->log->level > 2)
214 0 0 unless $self->brik_help_run_undef_arg($method, $uri)
218 0 0 defined $username ? :
219 0 0 defined $password ? :
221 0 0 unless (defined $self->client)
222 0 0 unless $client = $self->create_user_agent($uri, $username, $password)
227 0 0 if (defined $add_headers)
230 0 0 if (ref $v eq 'ARRAY') { }
244 0 0 if ($method ne "get" and ref $client eq "WWW::Mechanize::PhantomJS")
247 0 0 if ($method eq 'post' or $method eq 'put') { }
0 0 elsif ($method eq 'patch') { }
0 0 elsif ($method eq 'options' or $method eq 'patch') { }
263 0 0 if ($@)
265 0 0 if ($@ =~ /read timeout/i)
275 0 0 unless ($self->ignore_content)
276 0 0 if ($self->do_javascript) { }
287 0 0 if ($r{'content'} =~ /^Can't connect to .+Connection timed out at /is) { }
0 0 elsif ($r{'content'} =~ /^Can't connect to .+?\n\n(.+?) at /is) { }
0 0 elsif ($r{'content'} =~ /^Connect failed: connect: Interrupted system call/i) { }
316 0 0 unless $self->_method($uri, $username, $password, "get")
324 0 0 unless $self->brik_help_run_undef_arg("post", $href)
333 0 0 unless $self->brik_help_run_undef_arg("put", $href)
342 0 0 unless $self->brik_help_run_undef_arg("patch", $href)
372 0 0 unless (defined $last)
383 0 0 unless (defined $last)
387 0 0 if ($self->do_javascript)
401 0 0 unless $self->get(@args)
409 0 0 unless $self->post(@args)
418 0 0 unless (defined $last)
425 0 0 if ($@)
437 0 0 unless (defined $last)
460 0 0 unless $self->brik_help_run_undef_arg("delete_header", $header)
476 0 0 unless $self->brik_help_run_undef_arg("get_header", $header)
478 0 0 unless my $headers = $self->headers
479 0 0 if (exists $headers->{$header})
495 0 0 unless $self->brik_help_run_undef_arg("set_request_header", $header)
496 0 0 unless $self->brik_help_run_undef_arg("set_request_header", $value)
508 0 0 unless (defined $last)
525 0 0 unless (defined $last)
531 0 0 if ($self->log->level > 2)
540 0 0 unless my $content = $self->content
558 0 0 if ($type ne "submit")
574 0 0 unless $self->brik_help_run_undef_arg("trace_redirect", $uri)
590 0 0 if ($@)
601 0 0 if ($this->{'code'} != 302 and $this->{'code'} != 301)
617 0 0 unless $self->brik_help_run_undef_arg("screenshot", $uri)
618 0 0 unless $self->brik_help_run_undef_arg("screenshot", $output)
620 0 0 if ($self->brik_has_module("WWW::Mechanize::PhantomJS") and $self->brik_has_binary("phantomjs"))
622 0 0 unless my $mech = "WWW::Mechanize::PhantomJS"->new
625 0 0 unless my $get = $mech->get($uri)
628 0 0 unless my $data = $mech->content_as_png
631 0 0 unless my $write = "Metabrik::File::Write"->new_from_brik_init($self)
636 0 0 unless $write->open($output)
637 0 0 unless $write->write($data)
650 0 0 unless $self->brik_help_run_undef_arg("eval_javascript", $js)
654 0 0 if ($self->brik_has_module("WWW::Mechanize::PhantomJS") and $self->brik_has_binary("phantomjs"))
656 0 0 unless my $mech = "WWW::Mechanize::PhantomJS"->new("launch_arg", ["ghostdriver/src/main.js"])
671 0 0 unless $self->brik_help_run_undef_arg("info", $uri)
673 0 0 unless my $r = $self->get($uri)
718 0 0 if ($self->log->level > 2)
725 0 0 if defined $this
729 0 0 if (defined $title)
745 0 0 unless $self->brik_help_run_undef_arg("mirror", $url)
746 0 0 unless my $ref = $self->brik_help_run_invalid_arg("mirror", $url, "SCALAR", "ARRAY")
749 0 0 if ($ref eq 'ARRAY') { }
750 0 0 unless $self->brik_help_run_empty_array_arg("mirror", $url)
753 0 0 unless my $file = $self->mirror($this, $output)
758 0 0 unless ($url =~ m[^https?://] or $url =~ m[^ftp://])
762 0 0 unless my $sf = "Metabrik::System::File"->new_from_brik_init($self)
763 0 0 if (not defined $output) { }
764 0 0 unless my $filename = $sf->basefile($url)
768 0 0 unless ($sf->is_absolute($output))
775 0 0 unless my $mech = $self->create_user_agent
783 0 0 if ($@)
789 0 0 if ($code == 200) { }
0 0 elsif ($code == 304) { }
808 0 0 unless $self->brik_help_run_undef_arg("parse", $html)