5 my $debug = shift @ARGV;
7 use Test::More tests => 11;
8 use Data::Dump qw/dump/;
12 use_ok('CWMP::Response');
15 #ok( my $xml = join("",<DATA>), 'xml' );
18 ok( my $response = CWMP::Response->new({ debug => $debug }), 'new' );
19 isa_ok( $response, 'CWMP::Response' );
22 my ( $command, $template_xml ) = @_;
24 ok( my $xml = $response->$command({ ID => 42 }), $command );
27 chomp( $template_xml );
28 like( $xml, qr{^\Q$template_xml\E$}, $command . ' xml' );
31 is_like( 'InformResponse', <<__SOAP__
32 <soap:Envelope xmlns:cwmp="urn:dslforum-org:cwmp-1-0" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
34 <cwmp:ID mustUnderstand="1">42</cwmp:ID>
35 <cwmp:NoMoreRequests>0</cwmp:NoMoreRequests>
39 <cwmp:MaxEnvelopes>1</cwmp:MaxEnvelopes>
40 </cwmp:InformResponse>
46 is_like( 'GetRPCMethods', <<__SOAP__
47 <soap:Envelope xmlns:cwmp="urn:dslforum-org:cwmp-1-0" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
49 <cwmp:ID mustUnderstand="1">42</cwmp:ID>
50 <cwmp:NoMoreRequests>0</cwmp:NoMoreRequests>
59 is_like( 'Reboot', <<__SOAP__
60 <soap:Envelope xmlns:cwmp="urn:dslforum-org:cwmp-1-0" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
62 <cwmp:ID mustUnderstand="1">42</cwmp:ID>
63 <cwmp:NoMoreRequests>0</cwmp:NoMoreRequests>
72 is_like( 'GetParameterNames', <<__SOAP__
73 <soap:Envelope xmlns:cwmp="urn:dslforum-org:cwmp-1-0" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
75 <cwmp:ID mustUnderstand="1">42</cwmp:ID>
76 <cwmp:NoMoreRequests>0</cwmp:NoMoreRequests>
79 <cwmp:GetParameterNames>
80 <cwmp:ParameterPath></cwmp:ParameterPath>
81 <cwmp:NextLevel>0</cwmp:NextLevel>
82 </cwmp:GetParameterNames>