1 package OpenILS::Utils::TestUtils;
2 use base "OpenILS::Utils::Cronscript";
4 # The purpose of this module is to consolidate common routines that may
5 # be used by the integration tests in src/perlmods/live_t/
7 use strict; use warnings;
9 my $apputils = 'OpenILS::Application::AppUtils';
11 sub find_workstation {
12 my ($self,$name,$lib) = (shift,shift,shift);
13 my $resp = $apputils->simplereq(
15 'open-ils.actor.workstation.list',
20 return scalar(grep {$_->name() eq $name} @{$resp->{$lib}});
25 sub register_workstation {
26 my ($self,$name,$lib) = (shift,shift,shift);
27 my $resp = $apputils->simplereq(
29 'open-ils.actor.workstation.register',
30 $self->authtoken, $name, $lib);
34 sub find_or_register_workstation {
35 my ($self,$name,$lib) = (shift,shift,shift);
36 my $workstation = $self->find_workstation($name, $lib);
38 $workstation = $self->register_workstation($name, $lib);
44 my ($self,$args) = (shift,shift);
45 my $resp = $apputils->simplereq(
47 'open-ils.circ.checkout.full', $self->authtoken, $args);
52 my ($self,$args) = (shift,shift);
53 my $resp = $apputils->simplereq(
55 'open-ils.circ.checkin', $self->authtoken, $args );
59 sub do_checkin_override {
60 my ($self,$args) = (shift,shift);
61 my $resp = $apputils->simplereq(
63 'open-ils.circ.checkin.override', $self->authtoken, $args );