Branch Coverage

blib/lib/IO/EPP/Test/Base.pm
Criterion Covered Total %
branch 445 664 67.0


line true false branch
52 49 189 if (not $out_data or $out_data =~ m[]+/>]) { }
49 140 elsif ($out_data =~ //s) { }
1 139 elsif ($out_data =~ /]+>/) { }
11 128 elsif ($out_data =~ /]+>/) { }
2 126 elsif ($out_data =~ /]+>/) { }
4 122 elsif ($out_data =~ /]+>/) { }
2 120 elsif ($out_data =~ /]+>/) { }
1 119 elsif ($out_data =~ /]+>/) { }
8 111 elsif ($out_data =~ /]+>/) { }
2 109 elsif ($out_data =~ /]+>/) { }
3 106 elsif ($out_data =~ /]+>/) { }
2 104 elsif ($out_data =~ /]+>/) { }
2 102 elsif ($out_data =~ /]+>/) { }
12 90 elsif ($out_data =~ /]+>/) { }
4 86 elsif ($out_data =~ /]+>/) { }
5 81 elsif ($out_data =~ /]+>/) { }
20 61 elsif ($out_data =~ /]+>/) { }
4 57 elsif ($out_data =~ /]+>/) { }
7 50 elsif ($out_data =~ /]+>/) { }
1 49 elsif ($out_data =~ /]+>/) { }
49 0 elsif ($out_data =~ m[]) { }
211 0 49 unless $cltrid
213 0 49 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
217 0 49 unless ($body =~ s/^\s+//s)
222 49 0 if ($body =~ m[\s*\s*(.+?)\s+[^<>]+\s+\s+]s) { }
233 0 49 unless $login
249 0 49 if (not $pass or length $pass < 6)
264 0 49 if ($pass eq 'fail-pass')
288 0 1 unless $cltrid
290 0 1 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
294 0 1 unless ($body =~ s/^\s+//s)
298 0 1 unless ($body =~ s/^\s+\s+]+>\s+//s)
302 0 1 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
308 0 1 unless (scalar @contacts)
319 0 2 if ($s->data->{'conts'}{$cont_id})
323 0 2 $reason ? :
325 0 2 if $reason
351 0 13 unless $cltrid
353 0 13 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
357 0 13 unless ($body =~ s/^\s+//s)
361 0 13 unless ($body =~ s/^\s+<$act>\s+]+>\s+//s)
365 0 13 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
371 0 13 if ($i > 1)
378 0 13 if ($l > 1)
382 13 0 if ($i + $l == 0)
387 13 0 if ($body =~ m[([^<>]+)]) { }
398 11 2 if ($act eq 'create') { }
2 0 elsif ($act eq 'update') { }
399 1 10 if ($s->data->{'conts'}{$cont{'id'}})
400 1 0 if ($s->data->{'conts'}{$cont{'id'}}{'reason'} eq 'in use') { }
411 1 1 unless ($s->data->{'conts'}{$cont{'id'}} and $s->data->{'conts'}{$cont{'id'}}{'reason'} eq 'in use')
420 15 7 if ($body =~ m[(.+?)]s)
428 7 15 unless $pi
432 37 8 if ($pi =~ m[(.+?)]s) { }
7 1 elsif ($pi =~ m[]) { }
436 7 0 if ($f eq 'org') { }
444 0 1 if ($f eq 'name' and $act eq 'create')
454 0 15 unless (scalar @street)
459 19 0 if ($row =~ m[([^<>]+)])
465 60 0 if ($pi =~ m[(.+?)]s) { }
0 0 elsif ($pi =~ m[]) { }
469 0 0 if ($f eq 'sp') { }
481 0 15 unless ($cont{$t}{'addr'}{'cc'} and length $cont{$t}{'addr'}{'cc'} == 2)
485 0 15 unless ($cont{$t}{'addr'}{'cc'} =~ /^[A-Z]+$/)
491 21 10 if ($body =~ //) { }
10 0 elsif ($f eq 'fax' and $body =~ m[]) { }
496 24 0 if ($cf =~ m[([^<>]*)])
499 0 24 if (length $c == 0) { }
1 23 elsif ($f eq 'fax' || $f eq 'voice' and not $c =~ /^\+\d{1,3}\.\d{1,14}$/) { }
0 23 elsif ($f eq 'email' and not $c =~ /^[0-9a-z\.\-]+\@[0-9a-z\.\-]+$/) { }
522 10 0 if ($body =~ m[\s*([^<>]+)\s*]s) { }
0 0 elsif ($body =~ m[\s*\s*]) { }
531 1 9 if ($cont{'authInfo'} and length $cont{'authInfo'} < 16)
534 0 8 unless ($cont{'authInfo'} and $cont{'authInfo'} =~ /[A-Z]/ and $cont{'authInfo'} =~ /[a-z]/ and $cont{'authInfo'} =~ /[0-9]/ and $cont{'authInfo'} =~ m[[!\@\$\%*_.:\-=+?#,"'\\/&]])
540 7 1 if ($act eq 'create') { }
550 0 1 if ($old->{'owner'} ne $obj->{'user'})
562 1 1 if ($cont{$t}) { }
563 0 1 if $cont{$t}{'name'}
564 0 1 if ($cont{$t}{'org'}) { }
592 0 4 unless $cltrid
594 0 4 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
598 0 4 unless ($body =~ s/^\s+//s)
602 0 4 unless ($body =~ s/^\s+\s+]+>\s+//s)
606 0 4 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
611 4 0 if ($body =~ m[([^<>]+)]) { }
621 1 3 unless ($s->data->{'conts'}{$id})
631 3 0 if ($cont{'statuses'}{$s} eq '+') { }
640 5 1 if ($cont{$t})
642 4 1 $cont{$t}{'org'} ? :
646 5 0 $cont{$t}{'addr'}{'sp'} ? :
647 5 0 $cont{$t}{'addr'}{'sp'} ? :
648 5 0 $cont{$t}{'addr'}{'cc'} ? :
656 0 3 if (scalar @{$cont{'fax'};}) { }
670 3 0 if $cont{'updater'}
684 0 2 unless $cltrid
686 0 2 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
690 0 2 unless ($body =~ s/^\s+//s)
694 0 2 unless ($body =~ s/^\s+\s+]+>\s+//s)
698 0 2 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
703 2 0 if ($body =~ m[([^<>]+)]) { }
713 1 1 unless ($s->data->{'conts'}{$id})
717 0 1 if ($s->data->{'conts'}{$id}{'statuses'}{'linked'})
721 0 1 if ($s->data->{'conts'}{$id}{'owner'} ne $obj->{'user'})
738 0 1 unless $cltrid
740 0 1 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
744 0 1 unless ($body =~ s/^\s+//s)
748 0 1 unless ($body =~ s/^\s+\s+]+>\s+//s)
752 0 1 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
758 0 1 unless (scalar @hosts)
771 1 2 if ($s->data->{'nss'}{$ns}) { }
1 1 elsif (not $ns =~ /^[0-9a-z\.\-]+$/) { }
779 2 1 $reason ? :
781 2 1 if $reason
807 0 8 unless $cltrid
809 0 8 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
813 0 8 unless ($body =~ s/^\s+//s)
817 0 8 unless ($body =~ s/^\s+\s+]+>\s+//s)
821 0 8 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
826 8 0 if ($body =~ m[([0-9A-Za-z\-\.]+)]) { }
838 1 7 if ($nss->{$ns})
846 7 27 if ($ns =~ /\.$dm$/)
847 1 6 if ($doms->{$dm}{'owner'} ne $obj->{'user'}) { }
2 4 elsif (scalar(@v4) + scalar(@v6) == 0) { }
859 0 3 unless ($v =~ /^\d+\.\d+\.\d+\.\d+$/)
864 1 0 unless ($v =~ /^[0-9a-z:]{1,29}$/)
873 3 0 if ($local_ns)
886 0 2 unless $cltrid
888 0 2 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
892 0 2 unless ($body =~ s/^\s+//s)
896 0 2 unless ($body =~ s/^\s+\s+]+>\s+//s)
900 0 2 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
905 2 0 if ($body =~ m[([0-9A-Za-z\-\.]+)]) { }
916 1 1 unless ($nss->{$ns})
924 1 0 if ($nss->{$ns}{'statuses'}{$st} eq '+') { }
940 0 1 if $nss->{$ns}{'upd_date'}
952 0 3 unless $cltrid
954 0 3 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
958 0 3 unless ($body =~ s/^\s+//s)
962 0 3 unless ($body =~ s/^\s+\s+]+>\s+//s)
966 0 3 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
971 3 0 if ($body =~ m[([0-9A-Za-z\-\.]+)]) { }
982 1 2 unless ($nss->{$ns})
986 0 2 if ($nss->{$ns}{'owner'} ne $obj->{'user'})
994 2 1 if ($body =~ m[(.+?)]s)
1001 0 1 unless ($v =~ /^\d+\.\d+\.\d+\.\d+$/)
1005 1 0 if ($act eq 'add') { }
1009 1 0 unless ($v =~ /^[0-9a-f:]{1,29}$/)
1013 0 0 if ($act eq 'add') { }
1022 1 0 if (scalar @a4)
1030 0 1 if (scalar @a6)
1038 0 1 if (scalar @d4)
1046 0 1 if (scalar @d6)
1065 0 2 unless $cltrid
1067 0 2 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
1071 0 2 unless ($body =~ s/^\s+//s)
1075 0 2 unless ($body =~ s/^\s+\s+]+>\s+//s)
1079 0 2 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
1084 2 0 if ($body =~ m[([0-9A-Za-z\-\.]+)]) { }
1095 1 1 unless ($nss->{$ns})
1099 0 1 if ($nss->{$ns}{'statuses'}{'linked'})
1105 1 1 if ($ns =~ /\.$dm$/)
1110 0 1 if ($nss->{$ns}{'owner'} ne $obj->{'user'})
1127 0 2 unless $cltrid
1129 0 2 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
1133 0 2 unless ($body =~ s/^\s+//s)
1137 0 2 unless ($body =~ s/^\s+\s+]+>\s+//s)
1141 0 2 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
1147 0 2 unless (scalar @domains)
1160 2 18 if ($s->data->{'doms'}{$dm}) { }
1 17 elsif (not $dm =~ /^[0-9a-z\.\-]+$/) { }
0 17 elsif ($dm =~ /^reg/) { }
1 16 elsif ($dm =~ /^blo/) { }
1 15 elsif ($dm =~ /^ava/) { }
1177 3 12 int rand 10 == 1 ? :
1180 6 14 $reason ? :
1182 18 2 unless ($s->data->{'doms'}{$dm})
1183 4 14 if ($reason and not $reason =~ /not permitted/)
1188 6 14 if $reason
1214 0 12 unless $cltrid
1216 0 12 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
1220 0 12 unless ($body =~ s/^\s+//s)
1224 0 12 unless ($body =~ s/^\s+\s+]+>\s+//s)
1228 0 12 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
1233 12 0 if ($body =~ m[([^<>]+)]) { }
1240 1 11 if ($dname =~ /([^0-9a-z\.\-])/)
1244 1 10 unless ($dname =~ /^[0-9a-z\.\-]+\.[0-9a-z\-]+$/)
1254 2 8 if ($doms->{$dname})
1259 8 0 if ($body =~ m[([^<>]+)]) { }
1262 0 8 if ($period =~ /([^0-9])/)
1270 0 8 if ($period < 1 or $period > 9)
1275 7 1 if ($body =~ m[([^<>]+)]) { }
1278 1 6 unless ($conts->{$reg_id})
1291 15 1 if ($conts->{$ac}) { }
1301 5 0 if ($body =~ m[\s*([^<>]+)\s*]s) { }
1307 1 4 if ($pw and length $pw < 16)
1310 0 3 unless ($pw and $pw =~ /[A-Z]/ and $pw =~ /[a-z]/ and $pw =~ /[0-9]/ and $pw =~ m[[!\@\$\%*_.:\-=+?#,"'\\/&]])
1315 3 0 if ($body =~ m[(.+?)]s)
1321 1 4 unless ($nss->{$ns})
1352 1 1 if ($conts->{$reg_id}{'statuses'}{'ok'})
1362 3 3 if ($conts->{$c}{'statuses'}{'ok'})
1372 0 4 if ($nss->{$ns}{'statuses'}{'ok'})
1387 0 4 unless $cltrid
1389 0 4 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
1393 0 4 unless ($body =~ s/^\s+//s)
1397 0 4 unless ($body =~ s/^\s+\s+]+>\s+//s)
1401 0 4 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
1406 4 0 if ($body =~ m[([^<>]+)]) { }
1413 0 4 if ($dname =~ /([^0-9a-z\.\-])/)
1417 0 4 unless ($dname =~ /^[0-9a-z\.\-]+\.[0-9a-z\-]+$/)
1425 1 3 unless ($s->data->{'doms'}{$dname})
1433 1 2 if (scalar keys %{$$dm{'statuses'};}) { }
1438 1 0 if ($dm->{'statuses'}{$st} eq '+') { }
1452 3 0 if ($dm->{'nss'} and scalar keys %{$$dm{'nss'};})
1459 1 0 if ($dm->{'hosts'} and scalar keys %{$$dm{'hosts'};})
1471 0 3 if $dm->{'trans_date'}
1483 0 5 unless $cltrid
1485 0 5 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
1489 0 5 unless ($body =~ s/^\s+//s)
1493 0 5 unless ($body =~ s/^\s+\s+]+>\s+//s)
1497 0 5 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
1502 5 0 if ($body =~ m[([^<>]+)]) { }
1509 0 5 if ($dname =~ /([^0-9a-z\.\-])/)
1513 0 5 unless ($dname =~ /^[0-9a-z\.\-]+\.[0-9a-z\-]+$/)
1521 0 5 unless ($s->data->{'doms'}{$dname})
1528 1 9 if ($dm->{'statuses'}{$s})
1534 4 0 if ($body =~ m[(\d+)])
1537 1 3 if ($period > 9)
1543 2 1 if ($body =~ m[(\d\d\d\d-\d\d-\d\d)]) { }
1551 1 1 if ($old_exp_date ne $edt)
1607 0 20 unless $cltrid
1609 0 20 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
1613 0 20 unless ($body =~ s/^\s+//s)
1617 0 20 unless ($body =~ s/^\s+\s+]+>\s+//s)
1621 0 20 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
1626 20 0 if ($body =~ m[([^<>]+)]) { }
1633 0 20 if ($dname =~ /([^0-9a-z\.\-])/)
1637 0 20 unless ($dname =~ /^[0-9a-z\.\-]+\.[0-9a-z\-]+$/)
1647 1 19 unless ($s->data->{'doms'}{$dname})
1653 1 18 if ($dm->{'statuses'}{'serverUpdateProhibited'})
1657 2 16 $dm->{'statuses'}{'clientUpdateProhibited'} ? :
1659 6 12 if ($body =~ m[(.+?)]s)
1665 1 0 if ($no_upd and $st eq 'clientUpdateProhibited')
1671 1 17 if ($no_upd)
1681 9 8 if ($body =~ m[(.+?)]s)
1688 1 3 unless ($statuses{$st})
1692 1 2 if ($dm->{'statuses'}{$st})
1700 2 19 if ($add =~ m[([^<>]+)])
1703 0 2 unless ($$conts{$add{$t}})
1709 3 4 if ($add =~ m[(.+?)]s)
1717 2 1 if ($nss->{$h}) { }
1727 6 8 if ($body =~ m[(.+?)]s)
1733 0 1 unless ($statuses{$st})
1737 0 1 unless ($dm->{'statuses'}{$st})
1745 2 16 if ($rem =~ m[([^<>]+)])
1748 0 2 unless ($$conts{$rem{$t}})
1752 0 2 unless ($dm->{$t}{$rem{$t}})
1758 3 3 if ($rem =~ m[(.+?)]s)
1766 1 2 if ($add{'nss'}{$h})
1771 1 1 if ($dm->{'nss'}{$h}) { }
1782 1 36 if ($add{$t} and not $rem{$t})
1786 1 34 if (not $add{$t} and $rem{$t})
1791 5 6 if ($body =~ m[(.+?)]s)
1794 2 3 if ($chg =~ m[([^<>]+)])
1797 1 1 unless ($$conts{$chg{'registrant'}})
1802 3 1 if ($chg =~ m[authInfo.+([^<>]*).+authInfo]s)
1805 1 2 if ($pw and length $pw < 16)
1809 0 1 unless ($pw and $pw =~ /[A-Z]/ and $pw =~ /[a-z]/ and $pw =~ /[0-9]/ and $pw =~ m[[!\@\$\%*_.:\-=+?#,"'\\/&]])
1818 5 3 if (scalar keys %add)
1819 2 3 if ($add{'statuses'})
1826 1 14 if ($add{$t})
1831 1 0 if ($$conts{$add{$t}}{'statuses'}{'ok'})
1838 2 3 if ($add{'nss'})
1844 1 0 if ($nss->{$ns}{'statuses'}{'ok'})
1852 4 4 if (scalar keys %rem)
1853 1 3 if ($rem{'statuses'})
1860 1 11 if ($rem{$t})
1865 0 1 if ($$conts{$rem{$t}}{'statuses'}{'linked'} <= 0)
1874 2 2 if ($rem{'nss'})
1880 1 0 if ($nss->{$ns}{'statuses'}{'linked'} <= 0)
1890 1 7 if ($chg{'registrant'})
1893 0 1 if ($$conts{$dm->{'registrant'}}{'statuses'}{'linked'} <= 0)
1904 1 0 if ($$conts{$chg{'registrant'}}{'statuses'}{'ok'})
1910 1 7 if $chg{'authInfo'}
1923 0 4 unless $cltrid
1925 0 4 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
1929 0 4 unless ($body =~ s/^\s+//s)
1933 0 4 unless ($body =~ s/^\s+\s+]+>\s+//s)
1937 0 4 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
1942 4 0 if ($body =~ m[([^<>]+)]) { }
1949 0 4 if ($dname =~ /([^0-9a-z\.\-])/)
1953 0 4 unless ($dname =~ /^[0-9a-z\.\-]+\.[0-9a-z\-]+$/)
1963 1 3 unless ($doms->{$dname})
1969 1 2 unless ($dm->{'reason'} eq 'in use')
1974 0 8 if ($dm->{'statuses'}{$st})
1979 1 1 if ($dm->{'hosts'})
1981 1 1 if ($nss->{$h}{'statuses'}{'linked'})
1987 0 1 if ($dm->{'hosts'})
1995 1 0 if ($$conts{$dm->{'registrant'}}{'statuses'}{'linked'} <= 0)
2005 1 2 if ($conts->{$c}{'statuses'}{'linked'} <= 0)
2016 2 0 if ($nss->{$ns}{'statuses'}{'linked'} <= 0)
2035 0 7 unless $cltrid
2037 0 7 unless ($body =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>\s+//s)
2041 0 7 unless ($body =~ s/^\s+//s)
2046 7 0 if ($body =~ //) { }
2053 0 7 unless ($body =~ s/^\s+\s+]+>\s+//s)
2057 0 7 unless ($body =~ s[\s+\s+\s+[^<>]+\s+\s+\s*$][]s)
2062 7 0 if ($body =~ m[([^<>]+)]) { }
2069 0 7 if ($dname =~ /([^0-9a-z\.\-])/)
2073 0 7 unless ($dname =~ /^[0-9a-z\.\-]+\.[0-9a-z\-]+$/)
2081 1 6 unless ($doms->{$dname})
2087 0 4 if ($op eq 'cancel' or $op eq 'reject' or $op eq 'approve')
2088 1 1 unless ($dm->{'statuses'}{'pendingTransfer'})
2093 1 4 if ($op eq 'query')
2094 0 1 unless ($dm->{'statuses'}{'pendingTransfer'})
2098 0 1 unless ($dm->{'owner'} eq $obj->{'user'} or $dm->{'transfer'}{'new_owner'} eq $obj->{'user'})
2116 3 1 if ($op eq 'request')
2117 1 2 if ($dm->{'owner'} eq $obj->{'user'})
2122 0 8 if ($dm->{'statuses'}{$st})
2128 1 2 if ($op eq 'cancel')
2129 1 0 if ($dm->{'transfer'}{'new_owner'} eq $obj->{'user'})
2139 0 2 if ($op eq 'reject')
2140 0 0 if ($dm->{'owner'} eq $obj->{'user'})
2150 0 2 if ($op eq 'approve')
2151 0 0 if ($dm->{'owner'} eq $obj->{'user'})
2166 2 0 if ($body =~ m[(\d+)])
2169 0 2 if ($period > 9)
2174 2 0 if ($body =~ m[authInfo.+([^<>]+).+authInfo]s)
2177 1 1 if ($pw ne $dm->{'authInfo'})
2211 0 1 unless $cltrid
2233 0 49 unless ($body =~ s/^<\?xml[^<>]+\?>\s+]+>//s)
2237 0 49 unless ($body =~ m[(.+?)]s)
2245 49 0 if ($cltrid)