File: rt70329.t

package info (click to toggle)
libsoap-lite-perl 1.27-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 1,680 kB
  • sloc: perl: 8,908; makefile: 23; cs: 16
file content (37 lines) | stat: -rw-r--r-- 809 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/perl
#
# Tests the error described in rt.cpan.org #70329
#
# The error came from handling multiref ids, and unconditionally
# overwriting the id attribute
#
#
use Test::More tests => 1;
use 5.006;
use strict;
use warnings;
use SOAP::Lite +trace => [ 'debug' ];

my $req1 = SOAP::Lite->new(
    readable => 1,
    autotype => 0,
    proxy    => 'LOOPBACK://',
);

# req1 does not generate the XML attribute <item id="0"> it just generates
# <item>

my $content = SOAP::Data->new(
        name => 'item',
        attr => { "id" => 1 },
        value => \SOAP::Data->new(
            name => 'foo',
            value => 1,
        ),
     );

my $response = $req1->requestMessage(\$content);
my $response_item = $response->dataof("//item");

is($content->attr->{ id }, $response_item->attr->{ id });