Bugzilla – Attachment 123369 Details for
Bug 28741
OAI ListSets does not correctly build resumption token
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28741: Regression tests
Bug-28741-Regression-tests.patch (text/plain), 2.43 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-08-02 12:37:12 UTC
(
hide
)
Description:
Bug 28741: Regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-08-02 12:37:12 UTC
Size:
2.43 KB
patch
obsolete
>From eb288de1aa7c72e01895f93bf2742947999d5f4c Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 30 Jul 2021 14:53:31 -0300 >Subject: [PATCH] Bug 28741: Regression tests > >This patch adds regression tests for the behavior. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/OAI/Server.t | 58 ++++++++++++++++++++++++++++++++++++- > 1 file changed, 57 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/OAI/Server.t b/t/db_dependent/OAI/Server.t >index 48fea418eb..9294cc604c 100755 >--- a/t/db_dependent/OAI/Server.t >+++ b/t/db_dependent/OAI/Server.t >@@ -21,7 +21,7 @@ use Modern::Perl; > use Test::Deep qw( cmp_deeply re ); > use Test::MockTime qw/set_fixed_time restore_time/; > >-use Test::More tests => 31; >+use Test::More tests => 32; > use DateTime; > use File::Basename; > use File::Spec; >@@ -34,6 +34,7 @@ use t::lib::Mocks; > > use C4::Biblio qw( AddBiblio GetMarcBiblio ModBiblio ); > use C4::Context; >+use C4::OAI::Sets qw(AddOAISet); > > use Koha::Biblio::Metadatas; > use Koha::Database; >@@ -430,3 +431,58 @@ subtest 'Bug 20665: OAI-PMH Provider should reset the MySQL connection time zone > > > $schema->storage->txn_rollback; >+ >+subtest 'ListSets tests' => sub { >+ >+ plan tests => 2; >+ >+ t::lib::Mocks::mock_preference( 'OAI::PMH' => 1 ); >+ t::lib::Mocks::mock_preference( 'OAI-PMH:MaxCount' => 3 ); >+ >+ $schema->storage->txn_begin; >+ >+ $dbh->do('DELETE FROM oai_sets'); >+ >+ # Add a bunch of sets >+ my @sets = (); >+ for my $i ( 1 .. 3 ) { >+ >+ AddOAISet( >+ { 'spec' => "setSpec_$i", >+ 'name' => "setName_$i", >+ } >+ ); >+ push @sets, { setSpec => "setSpec_$i", setName => "setName_$i" }; >+ } >+ >+ # Add one more to force pagination >+ AddOAISet( >+ { 'spec' => "setSpec_4", >+ 'name' => "setName_4", >+ } >+ ); >+ >+ test_query( >+ 'ListSets', >+ { verb => 'ListSets' }, >+ { ListSets => { >+ resumptionToken => { >+ content => re( qr{^/3////1/0/3$} ), >+ cursor => 3, >+ }, >+ set => \@sets >+ } >+ } >+ ); >+ >+ test_query( >+ 'ListSets', >+ { verb => 'ListSets', resumptionToken => "/9/1970-01-01T00:00:00Z///0/0/3" }, >+ { ListSets => { >+ set => { setSpec => "setSpec_4", setName => "setName_4" } >+ } >+ } >+ ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.32.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28741
:
123063
|
123066
|
123369
|
123382
|
123383
|
123384
|
124054