WWW/eNom/DomainTransfer.pm

filter: Statementstmt 92.3% 36 / 39 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 18 MC/DCmcdc 0.0% 0 / 12 Subroutinesub 87.5% 7 / 8 Podpod n/a totaltotal 48.3% 43 / 89 CC 13 SCAR 47.8
CC
13
Cov
52%
construct_from_response
182.0
BEGIN
1.0
BEGIN
1.0
CRAP 118.7
↑ Summary WWW/eNom/Role/Command/Contact.pm »
1 package WWW::eNom::DomainTransfer;
2  
3 49 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 49 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 49 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 49 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 49 ▶use MooseX::Params::Validate;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 49 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 49 ▶use WWW::eNom::Types qw( Bool Contact DomainName HashRef PositiveInt Str );
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 49 our $VERSION = 'v2.7.0'; # VERSION
14 # ABSTRACT: Representation of In Progress Domain Transfer
15  
16 49 has 'order_id' => (
17 is => 'ro',
18 isa => PositiveInt,
19 required => 1,
20 );
21  
22 49 has 'name' => (
23 is => 'ro',
24 isa => DomainName,
25 required => 1,
26 );
27  
28 49 has 'status' => (
29 is => 'ro',
30 isa => Str,
31 required => 1,
32 );
33  
34 49 has 'status_id' => (
35 is => 'ro',
36 isa => PositiveInt,
37 required => 1,
38 );
39  
40 49 has 'is_locked' => (
41 is => 'ro',
42 isa => Bool,
43 required => 1,
44 );
45  
46 49 has 'is_auto_renew' => (
47 is => 'ro',
48 isa => Bool,
49 required => 1,
50 );
51  
52 49 has 'use_existing_contacts' => (
53 is => 'ro',
54 isa => Bool,
55 required => 1,
56 );
57  
58 49 has 'registrant_contact' => (
59 is => 'ro',
60 isa => Contact,
61 predicate => 'has_registrant_contact',
62 );
63  
64 49 has 'admin_contact' => (
65 is => 'ro',
66 isa => Contact,
67 predicate => 'has_admin_contact',
68 );
69  
70 49 has 'technical_contact' => (
71 is => 'ro',
72 isa => Contact,
73 predicate => 'has_technical_contact',
74 );
75  
76 49 has 'billing_contact' => (
77 is => 'ro',
78 isa => Contact,
79 predicate => 'has_billing_contact',
80 );
81  
82 49 with 'WWW::eNom::Role::ParseDomain';
83  
84 0 ▶sub construct_from_response {
Subroutine construct_from_response: not called CC=13 SCAR=52.0
85 0 my $self = shift;
86 0 my ( %args ) = validated_hash(
87 \@_,
88 transfer_detail => { isa => HashRef },
89 );
90  
91 # Note how we check both Admin and Administrative, we do this because eNom
92 # responds with Both depending on which route was called.
93 return $self->new(
94 order_id => $args{transfer_detail}{transferorderdetailid},
95 name => sprintf('%s.%s', $args{transfer_detail}{sld}, $args{transfer_detail}{tld} ),
96 status => $args{transfer_detail}{statusdesc},
97 status_id => $args{transfer_detail}{statusid},
98 is_locked => ( $args{transfer_detail}{lock} eq 'True' ),
99 is_auto_renew => ( $args{transfer_detail}{renew} eq 'True' ),
100 use_existing_contacts => ( $args{transfer_detail}{usecontacts} == 1 ),
101 exists $args{transfer_detail}{contacts}{Registrant} && $args{transfer_detail}{contacts}{Registrant} ne 'None'
102 ? ( registrant_contact => WWW::eNom::Contact->construct_from_response( $args{transfer_detail}{contacts}{Registrant} ) )
103 : ( ),
104 exists $args{transfer_detail}{contacts}{Admin} && $args{transfer_detail}{contacts}{Admin} ne 'None'
105 ? ( admin_contact => WWW::eNom::Contact->construct_from_response( $args{transfer_detail}{contacts}{Admin} ) )
106 : ( ),
107 exists $args{transfer_detail}{contacts}{Administrative} && $args{transfer_detail}{contacts}{Administrative} ne 'None'
108 ? ( admin_contact => WWW::eNom::Contact->construct_from_response( $args{transfer_detail}{contacts}{Administrative} ) )
109 : ( ),
110 exists $args{transfer_detail}{contacts}{Tech} && $args{transfer_detail}{contacts}{Tech} ne 'None'
111 ? ( technical_contact => WWW::eNom::Contact->construct_from_response( $args{transfer_detail}{contacts}{Tech} ) )
112 : ( ),
113 exists $args{transfer_detail}{contacts}{Technical} && $args{transfer_detail}{contacts}{Technical} ne 'None'
114 ? ( technical_contact => WWW::eNom::Contact->construct_from_response( $args{transfer_detail}{contacts}{Technical} ) )
115 : ( ),
116 exists $args{transfer_detail}{contacts}{AuxBilling} && $args{transfer_detail}{contacts}{AuxBilling} ne 'None'
117 0 ▶ ? ( billing_contact => WWW::eNom::Contact->construct_from_response( $args{transfer_detail}{contacts}{AuxBilling} ) )
Branch: 6 branches
BranchTrueFalseTotal
exists $args{'transfer_detail'}{'contacts'}{'Registrant'} && $args{'transfer_detail'}{'contacts'}{'Registrant'} ne 'None' ? : 0 0 0
exists $args{'transfer_detail'}{'contacts'}{'Admin'} && $args{'transfer_detail'}{'contacts'}{'Admin'} ne 'None' ? : 0 0 0
exists $args{'transfer_detail'}{'contacts'}{'Administrative'} && $args{'transfer_detail'}{'contacts'}{'Administrative'} ne 'None' ? : 0 0 0
exists $args{'transfer_detail'}{'contacts'}{'Tech'} && $args{'transfer_detail'}{'contacts'}{'Tech'} ne 'None' ? : 0 0 0
exists $args{'transfer_detail'}{'contacts'}{'Technical'} && $args{'transfer_detail'}{'contacts'}{'Technical'} ne 'None' ? : 0 0 0
exists $args{'transfer_detail'}{'contacts'}{'AuxBilling'} && $args{'transfer_detail'}{'contacts'}{'AuxBilling'} ne 'None' ? : 0 0 0
Condition0%0/18
exists $args{"transfer_detail"}{"contacts"}{"Registrant"} and $args{"transfer_detail"}{"contacts"}{"Registrant"} ne "None"
!ll&&!rl&&r
000
exists $args{"transfer_detail"}{"contacts"}{"Admin"} and $args{"transfer_detail"}{"contacts"}{"Admin"} ne "None"
!ll&&!rl&&r
000
exists $args{"transfer_detail"}{"contacts"}{"Administrative"} and $args{"transfer_detail"}{"contacts"}{"Administrative"} ne "None"
!ll&&!rl&&r
000
exists $args{"transfer_detail"}{"contacts"}{"Tech"} and $args{"transfer_detail"}{"contacts"}{"Tech"} ne "None"
!ll&&!rl&&r
000
exists $args{"transfer_detail"}{"contacts"}{"Technical"} and $args{"transfer_detail"}{"contacts"}{"Technical"} ne "None"
!ll&&!rl&&r
000
exists $args{"transfer_detail"}{"contacts"}{"AuxBilling"} and $args{"transfer_detail"}{"contacts"}{"AuxBilling"} ne "None"
!ll&&!rl&&r
000
MC/DC0%0/2
exists $args{"transfer_detail"}{"contacts"}{"Registrant"} and $args{"transfer_detail"}{"contacts"}{"Registrant"} ne "None"
exists $args{"transfer_detail"}{"contacts"}{"Registrant"} $args{"transfer_detail"}{"contacts"}{"Registrant"} ne "None"
MC/DC0%0/2
exists $args{"transfer_detail"}{"contacts"}{"Admin"} and $args{"transfer_detail"}{"contacts"}{"Admin"} ne "None"
exists $args{"transfer_detail"}{"contacts"}{"Admin"} $args{"transfer_detail"}{"contacts"}{"Admin"} ne "None"
MC/DC0%0/2
exists $args{"transfer_detail"}{"contacts"}{"Administrative"} and $args{"transfer_detail"}{"contacts"}{"Administrative"} ne "None"
exists $args{"transfer_detail"}{"contacts"}{"Administrative"} $args{"transfer_detail"}{"contacts"}{"Administrative"} ne "None"
MC/DC0%0/2
exists $args{"transfer_detail"}{"contacts"}{"Tech"} and $args{"transfer_detail"}{"contacts"}{"Tech"} ne "None"
exists $args{"transfer_detail"}{"contacts"}{"Tech"} $args{"transfer_detail"}{"contacts"}{"Tech"} ne "None"
MC/DC0%0/2
exists $args{"transfer_detail"}{"contacts"}{"Technical"} and $args{"transfer_detail"}{"contacts"}{"Technical"} ne "None"
exists $args{"transfer_detail"}{"contacts"}{"Technical"} $args{"transfer_detail"}{"contacts"}{"Technical"} ne "None"
MC/DC0%0/2
exists $args{"transfer_detail"}{"contacts"}{"AuxBilling"} and $args{"transfer_detail"}{"contacts"}{"AuxBilling"} ne "None"
exists $args{"transfer_detail"}{"contacts"}{"AuxBilling"} $args{"transfer_detail"}{"contacts"}{"AuxBilling"} ne "None"
Truth table0%0/3
A and B
A= exists $args{"transfer_detail"}{"contacts"}{"Registrant"}B= $args{"transfer_detail"}{"contacts"}{"Registrant"} ne "None"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= exists $args{"transfer_detail"}{"contacts"}{"Admin"}B= $args{"transfer_detail"}{"contacts"}{"Admin"} ne "None"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= exists $args{"transfer_detail"}{"contacts"}{"Administrative"}B= $args{"transfer_detail"}{"contacts"}{"Administrative"} ne "None"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= exists $args{"transfer_detail"}{"contacts"}{"Tech"}B= $args{"transfer_detail"}{"contacts"}{"Tech"} ne "None"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= exists $args{"transfer_detail"}{"contacts"}{"Technical"}B= $args{"transfer_detail"}{"contacts"}{"Technical"} ne "None"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= exists $args{"transfer_detail"}{"contacts"}{"AuxBilling"}B= $args{"transfer_detail"}{"contacts"}{"AuxBilling"} ne "None"
ABresult
0X0
100
111
118 : ( ),
119 );
120 }
121  
122 49 __PACKAGE__->meta->make_immutable;
123 49 1;
124  
125 __END__
↑ Summary WWW/eNom/Role/Command/Contact.pm »