Selenium/Remote/Mock/Commands.pm

filter: Statementstmt 100% 31 / 31 Branchbran 100% 2 / 2 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 95.5% 43 / 45 CC 4 SCAR 9.2
CC
4
Cov
100%
get_method_name_from_parameters
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.5
« Selenium/CanStartBinary/ProbePort.pm ↑ Summary Selenium/Remote/ErrorHandler.pm »
1 package Selenium::Remote::Mock::Commands;
2 4 $Selenium::Remote::Mock::Commands::VERSION = '1.50';
3 # ABSTRACT: utility class to mock Selenium::Remote::Commands
4  
5 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 extends 'Selenium::Remote::Commands';
10  
11  
12 # override get_params so we do not rewrite the parameters
13  
14 90 ▶sub get_params {
Subroutine get_params: called CC=1 SCAR=0.0
Pod undocumented
15 90 my $self = shift;
16 90 my $args = shift;
17 90 my $data = {};
18 90 my $command = delete $args->{command};
19 90 $data->{'url'} = $self->get_url($command);
20 90 $data->{'method'} = $self->get_method($command);
21 90 $data->{'no_content_success'} = $self->get_no_content_success($command);
22 90 $data->{'url_params'} = $args;
23 90 return $data;
24 }
25  
26 98 ▶sub get_method_name_from_parameters {
Subroutine get_method_name_from_parameters: called CC=4 SCAR=13.9
Pod undocumented
27 98 my $self = shift;
28 98 my $params = shift;
29 98 my $method_name = '';
30 98 my $cmds = $self->get_cmds();
31 98 foreach my $cmd ( keys %{$cmds} ) {
32 4787 ▶ if ( ( $cmds->{$cmd}->{method} eq $params->{method} )
Branch: 1 branch
BranchTrueFalseTotal
if ($cmds->{$cmd}{"method"} eq $params->{"method"} and $cmds->{$cmd}{"url"} eq $params->{"url"}) 98 4689 4787
Condition100%3/3
$cmds->{$cmd}{"method"} eq $params->{"method"} and $cmds->{$cmd}{"url"} eq $params->{"url"}
!ll&&!rl&&r
2556213398
MC/DC100%2/2
$cmds->{$cmd}{"method"} eq $params->{"method"} and $cmds->{$cmd}{"url"} eq $params->{"url"}
$cmds->{$cmd}{"method"} eq $params->{"method"} $cmds->{$cmd}{"url"} eq $params->{"url"}
Truth table100%3/3
A and B
A= $cmds->{$cmd}{"method"} eq $params->{"method"}B= $cmds->{$cmd}{"url"} eq $params->{"url"}
ABresult
0X0
100
111
33 && ( $cmds->{$cmd}->{url} eq $params->{url} ) )
34 {
35 98 $method_name = $cmd;
36 98 last;
37 }
38 }
39 98 return $method_name;
40 }
41  
42 4 1;
43  
44 __END__
« Selenium/CanStartBinary/ProbePort.pm ↑ Summary Selenium/Remote/ErrorHandler.pm »