| 1 | package Zonemaster::TestMethods v1.0.0; | ||
| 2 | |||
| 3 | use 5.14.2; | ||
| 4 | use strict; | ||
| 5 | use warnings; | ||
| 6 | |||
| 7 | use List::MoreUtils qw[uniq]; | ||
| 8 | |||
| 9 | use Zonemaster; | ||
| 10 | use Zonemaster::Util; | ||
| 11 | |||
| 12 | sub method1 { | ||
| 13 | my ( $class, $zone ) = @_; | ||
| 14 | |||
| 15 | return $zone->parent; | ||
| 16 | } | ||
| 17 | |||
| 18 | sub method2 { | ||
| 19 | my ( $class, $zone ) = @_; | ||
| 20 | |||
| 21 | return $zone->glue_names; | ||
| 22 | } | ||
| 23 | |||
| 24 | sub method3 { | ||
| 25 | my ( $class, $zone ) = @_; | ||
| 26 | |||
| 27 | my @child_nsnames; | ||
| 28 | my @nsnames; | ||
| 29 | my $ns_aref = $zone->query_all( $zone->name, q{NS} ); | ||
| 30 | foreach my $p ( @{$ns_aref} ) { | ||
| 31 | next if not $p; | ||
| 32 | push @nsnames, $p->get_records_for_name( q{NS}, $zone->name ); | ||
| 33 | } | ||
| 34 | @child_nsnames = uniq map { name( lc( $_->nsdname ) ) } @nsnames; | ||
| 35 | |||
| 36 | return [@child_nsnames]; | ||
| 37 | } | ||
| 38 | |||
| 39 | sub method4 { | ||
| 40 | my ( $class, $zone ) = @_; | ||
| 41 | |||
| 42 | return $zone->glue; | ||
| 43 | } | ||
| 44 | |||
| 45 | sub method5 { | ||
| 46 | my ( $class, $zone ) = @_; | ||
| 47 | |||
| 48 | return $zone->ns; | ||
| 49 | } | ||
| 50 | |||
| 51 | =head1 NAME | ||
| 52 | |||
| 53 | Zonemaster::TestMethods - Methods common to Test Specification used in test modules | ||
| 54 | |||
| 55 | =head1 SYNOPSIS | ||
| 56 | |||
| 57 | my @results = Zonemaster::TestMethods->method1($zone); | ||
| 58 | |||
| 59 | =head1 METHODS | ||
| 60 | |||
| 61 | For details on what these methods implement, see the test | ||
| 62 | specification documents. | ||
| 63 | |||
| 64 | =over | ||
| 65 | |||
| 66 | =item method1($zone) | ||
| 67 | |||
| 68 | =item method2($zone) | ||
| 69 | |||
| 70 | =item method3($zone) | ||
| 71 | |||
| 72 | =item method4($zone) | ||
| 73 | |||
| 74 | =item method5($zone) | ||
| 75 | |||
| 76 | =back | ||
| 77 | |||
| 78 | =cut | ||
| 79 | |||
| 80 | 1; |