1use strict;
2use warnings;
3use Test::More tests => 4;
4
5use SOAP::WSDL::PortType;
6use_ok qw(SOAP::WSDL::Definitions);
7
8my $obj = SOAP::WSDL::Definitions->new({
9    portType => [
10        SOAP::WSDL::PortType->new({
11            name => 'foo',
12            targetNamespace => 'bar',
13        }),
14        SOAP::WSDL::PortType->new({
15            name => 'foo',
16            targetNamespace => 'baz',
17        }),
18        SOAP::WSDL::PortType->new({
19            name => 'foobar',
20            targetNamespace => 'bar',
21        }),
22    ]
23});
24
25
26my $found= $obj->find_portType('bar', 'foobar');
27is $found->get_name(), 'foobar', 'found PortType';
28$found = $obj->find_portType('baz', 'foo');
29is $found->get_name(), 'foo', 'found PortType';
30
31$found = $obj->find_portType('baz', 'foobar');
32is $found, undef, 'find_PortType returns undef on unknown PortType';