DRI/Protocol/EPP/Extensions/AusRegistry/Sync.pm

filter: Statementstmt 47.0% 16 / 34 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 5 / 10 Podpod 0.0% 0 / 5 totaltotal 36.2% 21 / 58 CC 4 SCAR 19.7
CC
4
Cov
39%
update
20.0
register_commands
2.0
setup
2.0
CRAP 7.2
« DRI/Protocol/EPP/Extensions/Afilias/MaintainerUrl.pm ↑ Summary DRI/DRD/DotCooperation.pm »
1 ## Domain Registry Interface, EPP AusRegistry Sync
2 ##
3 ## Copyright (c) 2016,2018-2019 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
4 ##
5 ## This file is part of Net::DRI
6 ##
7 ## Net::DRI is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; either version 2 of the License, or
10 ## (at your option) any later version.
11 ##
12 ## See the LICENSE file that comes with this distribution for more details.
13 ####################################################################################################
14  
15 package Net::DRI::Protocol::EPP::Extensions::AusRegistry::Sync;
16  
17 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use feature 'state';
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 ####################################################################################################
25  
26 sub register_commands
27 0 ▶{
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
28 0 my ($class,$version)=@_;
29 0 state $rop = { 'domain' => { 'update' => [ \&update, undef ] } };
30 0 return $rop;
31 }
32  
33 sub setup
34 0 ▶{
Subroutine setup: not called CC=1 SCAR=6.9
Pod undocumented
35 0 my ($class,$po,$version)=@_;
36 0 state $ns = { 'sync' => 'urn:X-ar:params:xml:ns:sync-1.0' };
37 0 $po->ns($ns);
38 0 return;
39 }
40  
41 0 ▶sub capabilities_add { return ('domain_update','sync',['set']); }
Subroutine capabilities_add: not called CC=1 SCAR=6.9
Pod undocumented
42  
43 0 ▶sub implements { return 'http://ausregistry.github.io/doc/Domain%20Expiry%20Synchronisation%20Extension%20Mapping%20for%20the%20Extensible%20Provisioning%20Protocol.docx'; }
Subroutine implements: not called CC=1 SCAR=6.9
Pod undocumented
44  
45 ####################################################################################################
46  
47 ############ Transform commands
48  
49 sub update
50 0 ▶{
Subroutine update: not called CC=4 SCAR=30.0
Pod undocumented
51 0 my ($epp,$domain,$todo)=@_;
52  
53 0 my $sync=$todo->set('sync');
54 0 ▶ return unless defined $sync && $sync;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $sync and $sync 0 0 0
Condition0%0/3
defined $sync and $sync
!ll&&!rl&&r
000
MC/DC0%0/2
defined $sync and $sync
defined $sync $sync
Truth table0%0/3
A and B
A= defined $syncB= $sync
ABresult
0X0
100
111
55  
56 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Sync operation can not be mixed with other domain changes') if grep { $_ ne 'sync' } $todo->types();
Branch: 1 branch
BranchTrueFalseTotal
if grep {$_ ne "sync";} $todo->types 0 0 0
57  
58 0 Net::DRI::Util::check_isa($sync,'DateTime');
59 0 my $date = $sync->clone()->set_time_zone('UTC')->strftime('%FT%T.%6NZ');
60  
61 0 $epp->message()->command_extension('sync', ['update', ['exDate', $date]]);
62 0 return;
63 }
64  
65 ####################################################################################################
66 1 1;
67  
68 __END__
« DRI/Protocol/EPP/Extensions/Afilias/MaintainerUrl.pm ↑ Summary DRI/DRD/DotCooperation.pm »