projects
/
webpac2
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added header_first to WebPAC::Input::CSV
[webpac2]
/
t
/
2-input-koha.t
diff --git
a/t/2-input-koha.t
b/t/2-input-koha.t
index
b278f72
..
0440987
100755
(executable)
--- a/
t/2-input-koha.t
+++ b/
t/2-input-koha.t
@@
-3,7
+3,7
@@
use strict;
use lib 'lib';
use strict;
use lib 'lib';
-use Test::More tests => 2
7
;
+use Test::More tests => 2
8
;
BEGIN {
use_ok( 'WebPAC::Test' );
BEGIN {
use_ok( 'WebPAC::Test' );
@@
-19,19
+19,20
@@
ok(my $input = new WebPAC::Input(
%LOG
), "new");
%LOG
), "new");
+my $path = '/tmp/koha.marc';
+
ok(my $db = $input->open(
ok(my $db = $input->open(
- path
=> '/tmp/koha.marc', # required?
+ path
=> $path,
dsn => 'dbi:mysql:database=koha',
user => $ENV{KOHA_USER},
passwd => $ENV{KOHA_PASSWD},
dsn => 'dbi:mysql:database=koha',
user => $ENV{KOHA_USER},
passwd => $ENV{KOHA_PASSWD},
- sql => q{
- select biblioitemnumber as mfn, marc from biblioitems limit 7
- },
+ limit => 7,
+ offset => 3,
), "open");
ok(my $size = $input->size, "size");
cmp_ok( $size, '==', 7, 'size ok' );
), "open");
ok(my $size = $input->size, "size");
cmp_ok( $size, '==', 7, 'size ok' );
-foreach my $mfn (
1 ...
$size ) {
+foreach my $mfn (
3 + 1 ... 3 +
$size ) {
my $rec = $input->fetch;
ok($rec, "fetch $mfn");
cmp_ok($rec->{'000'}->[0], '==', $mfn, 'has mfn');
my $rec = $input->fetch;
ok($rec, "fetch $mfn");
cmp_ok($rec->{'000'}->[0], '==', $mfn, 'has mfn');
@@
-39,3
+40,4
@@
foreach my $mfn ( 1 ... $size ) {
diag "rec: ", dump($rec), "\n" if $debug;
}
diag "rec: ", dump($rec), "\n" if $debug;
}
+ok( unlink $path, "unlink $path" );