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