1 package WebPAC::Input::Test;
8 use base qw/WebPAC::Common/;
9 use Data::Dump qw/dump/;
13 WebPAC::Input::Test - Mock test records for WebPAC
21 our $VERSION = '0.01';
27 $WebPAC::Input::Test::rec = {
41 $WebPAC::Input::Test::size = 42;
47 my $isis = new WebPAC::Input::Test(
48 path => '/path/to/LIBRI'
50 my ($l,$field_nr) = @_;
51 # do something with $l which is line of input file
56 C<filter> will be assigned to C<$WebPAC::Input::Test::filter>
69 $filter = $arg->{filter};
71 $self->_get_logger()->info("mocking Test database with args = ", dump($arg));
73 $self ? return $self : return undef;
78 Return record with ID C<$mfn> from database
80 my $rec = $isis->fetch_rec( $mfn );
82 Second argument, C<filter_coderef> will be assigned to
83 C<$WebPAC::Input::Test::filer_coderef>
94 $filter_coderef = shift;
96 $self->_get_logger()->debug("mfn = $mfn rec = ", dump($rec));
103 Return dump of record ID C<$mfn> from database
105 my $rec = $isis->dump_ascii( $mfn );
117 Return number of records in database
119 my $size = $isis->size;
127 $self->_get_logger()->debug("size = $size");
133 Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >>
135 =head1 COPYRIGHT & LICENSE
137 Copyright 2007 Dobrica Pavlinusic, All Rights Reserved.
139 This program is free software; you can redistribute it and/or modify it
140 under the same terms as Perl itself.
144 1; # End of WebPAC::Input::Test