import SOAP-WSDL 2.00_25 from CPAN
git-cpan-module: SOAP-WSDL git-cpan-version: 2.00_25 git-cpan-authorid: MKUTTER git-cpan-file: authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_25.tar.gz
This commit is contained in:
committed by
Michael G. Schwern
parent
84b53d9261
commit
a9033164e6
@@ -0,0 +1,64 @@
|
||||
package MyTypemap;
|
||||
sub get_typemap { return {} };
|
||||
|
||||
package HandlerClass;
|
||||
|
||||
sub bar {
|
||||
return "Verdammte Axt";
|
||||
}
|
||||
package main;
|
||||
use Test::More tests => 4;
|
||||
|
||||
use_ok(SOAP::WSDL::Server);
|
||||
use_ok(SOAP::WSDL::Server::CGI);
|
||||
|
||||
my $server = SOAP::WSDL::Server::CGI->new({
|
||||
class_resolver => 'MyTypemap',
|
||||
});
|
||||
$server->set_action_map_ref({
|
||||
'testaction' => 'testmethod',
|
||||
});
|
||||
|
||||
eval "require IO::Scalar"
|
||||
or exit 0;
|
||||
{
|
||||
no warnings qw(once);
|
||||
*IO::Scalar::BINMODE = sub {};
|
||||
}
|
||||
my $output = q{};
|
||||
my $fh = IO::Scalar->new(\$output);
|
||||
my $stdout = *STDOUT;
|
||||
|
||||
*STDOUT = $fh;
|
||||
|
||||
$server->handle();
|
||||
|
||||
like $output, qr{ \A Status: \s 411 \s Length \s Required}x;
|
||||
$output = q{};
|
||||
|
||||
$ENV{'CONTENT_LENGTH'} = '0e0';
|
||||
$server->handle();
|
||||
|
||||
like $output, qr{ Error \s deserializing }xsm;
|
||||
$output = q{};
|
||||
|
||||
$server->set_action_map_ref({
|
||||
'foo' => 'bar',
|
||||
});
|
||||
$server->set_dispatch_to( 'HandlerClass' );
|
||||
|
||||
$server->handle();
|
||||
|
||||
print "\n";
|
||||
|
||||
$ENV{HTTP_SOAPAction} = 'test';
|
||||
$server->handle();
|
||||
|
||||
print "\n";
|
||||
|
||||
$ENV{HTTP_SOAPAction} = 'foo';
|
||||
$server->handle();
|
||||
|
||||
*STDOUT = $stdout;
|
||||
|
||||
# print $output;
|
||||
Reference in New Issue
Block a user