@@ -, +, @@ --- t/db_dependent/OAI/Server.t | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) --- a/t/db_dependent/OAI/Server.t +++ a/t/db_dependent/OAI/Server.t @@ -17,19 +17,20 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . - use Modern::Perl; -use C4::Context; -use C4::Biblio; + use Test::More tests => 27; +use DateTime; use Test::MockModule; use Test::Warn; -use DateTime; use XML::Simple; -use t::lib::Mocks; -use t::lib::TestBuilder; use YAML; +use t::lib::Mocks; + +use C4::Biblio; +use C4::Context; +use Koha::Database; BEGIN { use_ok('Koha::OAI::Server::DeletedRecord'); @@ -45,30 +46,27 @@ BEGIN { use_ok('Koha::OAI::Server::ResumptionToken'); } - # Mocked CGI module in order to be able to send CGI parameters to OAI Server my %param; my $module = Test::MockModule->new('CGI'); - $module->mock('Vars', sub { %param; }); +$module->mock('Vars', sub { %param; }); my $schema = Koha::Database->schema; $schema->storage->txn_begin; my $dbh = C4::Context->dbh; -my $builder = t::lib::TestBuilder->new; - $dbh->do('SET FOREIGN_KEY_CHECKS = 0'); $dbh->do('TRUNCATE biblio'); $dbh->do('TRUNCATE biblioitems'); $dbh->do('TRUNCATE issues'); -# Add 10 biblio records our $tz = DateTime::TimeZone->new( name => 'local' ); my $date_added = DateTime->now(time_zone =>$tz) . 'Z'; my $date_to = substr($date_added, 0, 10) . 'T23:59:59Z'; - my (@header, @marcxml, @oaidc); -map { + +# Add 10 biblio records +foreach( 1..10 ) { my $record = MARC::Record->new(); $record->append_fields( MARC::Field->new('245', '', '', 'a' => "Title $_" ) ); my ($biblionumber) = AddBiblio($record, ''); @@ -109,9 +107,7 @@ map { }, }, }; - $biblionumber => undef; -} (1..10); - +} my $syspref = { 'LibraryName' => 'My Library', @@ -125,7 +121,6 @@ while ( my ($name, $value) = each %$syspref ) { t::lib::Mocks::mock_preference( $name => $value ); } - sub test_query { my ($test, $param, $expected) = @_; @@ -158,7 +153,6 @@ sub test_query { } } - test_query('ListMetadataFormats', {verb => 'ListMetadataFormats'}, { ListMetadataFormats => { metadataFormat => [ --