add debugging, properly export subs
[Net-HTTPS-Any.git] / t / get-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_get';
12 };
13
14 #200
15
16 my($content, $response, %headers) = https_get(
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 (OK) response');
25
26 ok( length($content), 'Received content' );
27
28 #404
29
30 my($content2, $response2, %headers2) = https_get(
31   { 'host' => 'secure.sisd.com',
32     'port' => 443,
33     'path' => '/freeside/notfound.html',
34   },
35   'net_https_any_test' => 1,
36 );
37
38 like($response2, qr/^HTTP\/[\d\.]+\s+404/i, 'Received 404 (OK) response');
39