- Pull in changes from Business::OnlinePayment::HTTPS 0.09 from
[Net-HTTPS-Any.git] / t / post-netssleay.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use Test::More;
6
7 BEGIN {
8   plan( tests=>4 );
9   use_ok 'Net::HTTPS::Any', 'https_post';
10 };
11
12 #200
13
14 my($content, $response, %headers) = https_post(
15   { 'host' => 'secure.sisd.com',
16     'port' => 443,
17     'path' => '/freeside/index.html',
18   },
19   'net_https_any_test' => 1,
20 );
21
22 #like($response, qr/^HTTP\/[\d\.]+\s+200/i, 'Received 200 (OK) response');
23 like($response, qr/^200/i, 'Received 200 (OK) response');
24
25 ok( length($content), 'Received content' );
26
27 #404
28
29 my($content2, $response2, %headers2) = https_post(
30   { 'host' => 'secure.sisd.com',
31     'port' => 443,
32     'path' => '/freeside/notfound.html',
33   },
34   'net_https_any_test' => 1,
35 );
36
37 #like($response2, qr/^HTTP\/[\d\.]+\s+404/i, 'Received 404 (Not Found) response');
38 like($response2, qr/^404/i, 'Received 404 (Not Found) response');
39