]> git.evergreen-ils.org Git - working/NCIPServer.git/blob - t/NCIP.t
Working on extending the functionality and test suite.
[working/NCIPServer.git] / t / NCIP.t
1 #
2 #===============================================================================
3 #
4 #         FILE: NCIP.t
5 #
6 #  DESCRIPTION:
7 #
8 #        FILES: ---
9 #         BUGS: ---
10 #        NOTES: ---
11 #       AUTHOR: Chris Cormack (rangi), chrisc@catalyst.net.nz
12 # ORGANIZATION: Koha Development Team
13 #      VERSION: 1.0
14 #      CREATED: 18/09/13 09:59:01
15 #     REVISION: ---
16 #===============================================================================
17
18 use strict;
19 use warnings;
20
21 use Test::More tests => 5;    # last test to print
22
23 use lib 'lib';
24
25 use_ok('NCIP');
26 ok( my $ncip = NCIP->new('t/config_sample'), 'Create new object' );
27
28 my $xml = <<'EOT';
29 <xml>
30 </xml>
31 EOT
32
33 ok( my $response = $ncip->process_request($xml), 'Process a request' );
34
35 my $xmlbad = <<'EOT';
36 <xml>
37 this is bad
38 <xml>
39 </xml>
40 EOT
41
42 # handle_initiation is called as part of the process_request, but best to test
43 # anyway
44 ok( !$ncip->handle_initiation($xmlbad), 'Bad xml' );
45 ok( $ncip->handle_initiation($xml),     'Good XML' );