DRI/Protocol/EPP/Extensions/CloudRegistry/LaunchPhase.pm

filter: Statementstmt 20.4% 10 / 49 Branchbran 0.0% 0 / 28 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 37.5% 3 / 8 Podpod 0.0% 0 / 5 totaltotal 13.6% 13 / 95 CC 17 SCAR 35.3
CC
17
Cov
12%
create
72.0
create_parse
20.0
info
20.0
CRAP 34.2
« DRI/Protocol/AdamsNames/WS/Message.pm ↑ Summary DRI/Protocol/EPP/Extensions/CentralNic/AuxContact.pm »
1 ## Domain Registry Interface, Cloud Registry LaunchPhase EPP Extension for managing Sunrise and Landrush
2 ##
3 ## Copyright (c) 2009-2011,2013 Cloud Registry Pty Ltd <http://www.cloudregistry.net>. All rights reserved.
4 ## Copyright (c) 2016,2019 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
5 ##
6 ## This file is part of Net::DRI
7 ##
8 ## Net::DRI is free software; you can redistribute it and/or modify
9 ## it under the terms of the GNU General Public License as published by
10 ## the Free Software Foundation; either version 2 of the License, or
11 ## (at your option) any later version.
12 ##
13 ## See the LICENSE file that comes with this distribution for more details.
14 ####################################################################################################
15  
16 package Net::DRI::Protocol::EPP::Extensions::CloudRegistry::LaunchPhase;
17  
18 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 =pod
24  
25 =head1 NAME
26  
27 Net::DRI::Protocol::EPP::Extensions::CloudRegistry::LaunchPhase - Cloud Registry LaunchPhase (Sunrise and Land Rush) EPP Extension for Net::DRI
28  
29 =head1 DESCRIPTION
30  
31 Please see the README file for details.
32  
33 =head1 SUPPORT
34  
35 Please use the issue tracker
36  
37 E<lt>https://github.com/cloudregistry/net-dri/issuesE<gt>
38  
39 Please also see the SUPPORT file in the distribution.
40  
41 =head1 SEE ALSO
42  
43 E<lt>http://www.cloudregistry.net/E<gt> and
44 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
45  
46 =head1 AUTHOR
47  
48 Wil Tan E<lt>wil@cloudregistry.netE<gt>
49  
50 =head1 COPYRIGHT
51  
52 Copyright (c) 2009-2011,2013 Cloud Registry Pty Ltd <http://www.cloudregistry.net>.
53 Copyright (c) 2016,2019 Patrick Mevzek <netdri@dotandco.com>
54 All rights reserved.
55  
56 This program is free software; you can redistribute it and/or modify
57 it under the terms of the GNU General Public License as published by
58 the Free Software Foundation; either version 2 of the License, or
59 (at your option) any later version.
60  
61 See the LICENSE file that comes with this distribution for more details.
62  
63 =cut
64  
65 ####################################################################################################
66  
67 sub register_commands
68 0 ▶{
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
69 0 my ($class,$version)=@_;
70 0 my %tmp=(
71 create => [ \&create, \&create_parse ],
72 info => [ \&info, \&info_parse ],
73 );
74  
75 0 return { 'domain' => \%tmp };
76 }
77  
78 ####################################################################################################
79  
80 sub create
81 0 ▶{
Subroutine create: not called CC=8 SCAR=42.8
Pod undocumented
82 0 my ($epp,$domain,$rd)=@_;
83  
84 0 ▶ return unless Net::DRI::Util::has_key($rd,'lp');
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::has_key($rd, "lp") 0 0 0
85  
86 0 my @lpdata;
87 0 ▶ push @lpdata, ['lp:trademark_name', $rd->{lp}->{trademark_name}] if exists $rd->{lp}->{trademark_name};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"trademark_name"} 0 0 0
88 0 ▶ push @lpdata, ['lp:trademark_number', $rd->{lp}->{trademark_number}] if exists $rd->{lp}->{trademark_number};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"trademark_number"} 0 0 0
89 0 ▶ push @lpdata, ['lp:trademark_locality', $rd->{lp}->{trademark_locality}] if exists $rd->{lp}->{trademark_locality};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"trademark_locality"} 0 0 0
90 0 ▶ push @lpdata, ['lp:trademark_entitlement', $rd->{lp}->{trademark_entitlement}] if exists $rd->{lp}->{trademark_entitlement};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"trademark_entitlement"} 0 0 0
91 0 ▶ push @lpdata, ['lp:pvrc', $rd->{lp}->{pvrc}] if exists $rd->{lp}->{pvrc};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"pvrc"} 0 0 0
92 0 ▶ push @lpdata, ['lp:phase', $rd->{lp}->{phase}] if exists $rd->{lp}->{phase};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"phase"} 0 0 0
93  
94 0 $epp->message()->command_extension('lp', ['create', @lpdata]);
95 0 return;
96 }
97  
98 sub create_parse
99 0 ▶{
Subroutine create_parse: not called CC=4 SCAR=30.0
Pod undocumented
100 0 my ($po, $otype, $oaction, $oname, $rinfo) = @_;
101 0 my $mes = $po->message();
102 0 my $creData = $mes->get_extension('lp','creData');
103  
104 0 ▶ return unless defined $creData;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $creData 0 0 0
105  
106 0 my $c = $creData->getElementsByTagNameNS($mes->ns('lp'), 'application_id');
107 0 ▶ $rinfo->{$otype}->{$oname}->{lp} = {application_id=>$c->get_node(1)->textContent()} if defined $c && $c->size();
Branch: 1 branch
BranchTrueFalseTotal
if defined $c and $c->size 0 0 0
Condition0%0/3
defined $c and $c->size
!ll&&!rl&&r
000
MC/DC0%0/2
defined $c and $c->size
defined $c $c->size
Truth table0%0/3
A and B
A= defined $cB= $c->size
ABresult
0X0
100
111
108 0 return;
109 }
110  
111 sub info
112 0 ▶{
Subroutine info: not called CC=4 SCAR=30.0
Pod undocumented
113 0 my ($epp,$domain,$rd)=@_;
114  
115 0 ▶ return unless Net::DRI::Util::has_key($rd,'lp');
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::has_key($rd, "lp") 0 0 0
116  
117 0 my @lpdata;
118 0 ▶ push @lpdata, ['lp:application_id', $rd->{lp}->{application_id}] if exists $rd->{lp}->{application_id};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"application_id"} 0 0 0
119 0 ▶ push @lpdata, ['lp:phase', $rd->{lp}->{phase}] if exists $rd->{lp}->{phase};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"phase"} 0 0 0
120  
121 0 $epp->message()->command_extension('lp', ['info', @lpdata]);
122 0 return;
123 }
124  
125 sub info_parse
126 0 ▶{
Subroutine info_parse: not called CC=4 SCAR=30.0
Pod undocumented
127 0 my ($po,$otype,$oaction,$oname,$rinfo)=@_;
128 0 my $mes=$po->message();
129 0 my $infdata=$mes->get_extension('lp','infData');
130  
131 0 ▶ return unless defined $infdata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $infdata 0 0 0
132  
133 0 my %lpdata;
134 0 my $ns=$mes->ns('lp');
135 0 foreach my $el (qw/trademark_name trademark_number trademark_locality trademark_entitlement pvrc phase/)
136 {
137 0 my $v=Net::DRI::Util::xml_child_content($infdata,$ns,$el);
138 0 ▶ $lpdata{$el}=$v if defined $v;
Branch: 1 branch
BranchTrueFalseTotal
if defined $v 0 0 0
139 }
140 0 $rinfo->{$otype}->{$oname}->{lp} = \%lpdata;
141 0 return;
142 }
143  
144 ####################################################################################################
145 1 1;
« DRI/Protocol/AdamsNames/WS/Message.pm ↑ Summary DRI/Protocol/EPP/Extensions/CentralNic/AuxContact.pm »