4 use Test::More tests => 8;
7 use_ok('Koha::Z3950Responder');
10 my $zR = Koha::Z3950Responder->new({});
12 my $args={ PEER_NAME => 'PEER'};
13 $zR->init_handler($args);
14 is ( $args->{IMP_NAME}, 'Koha',"Server returns basic info");
15 $args->{DATABASES} = ['biblios'];
16 $args->{QUERY} = 'biblios';
17 $args->{SETNAME} = 'biblios';
21 $zR->search_handler( $args );
22 is ( $args->{ERR_CODE}, 2, "We didn't start server , should fail");
23 is ( $args->{ERR_STR}, 'Cannot connect to upstream server', "We didn't start server, should fail because it cannot connect");
24 $zR->present_handler( $args );
25 is ( $args->{ERR_CODE}, 30, "There is no handler as we aren't connected");
26 is ( $args->{ERR_STR}, 'No such resultset', "We don't have a handler, should fail because we don't");
27 my $arg_check = ( $args );
28 $zR->fetch_handler( $args );
29 is_deeply( $args, $arg_check, "nothing should change");
30 $zR->close_handler( $args );
31 is_deeply( $args, $arg_check, "nothing should change");