Bugzilla – Attachment 69997 Details for
Bug 19725
OAI-PMH ListRecords and ListIdentifiers should use biblio_metadata.timestamp
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19725: Add failing test
Bug-19725-Add-failing-test.patch (text/plain), 3.32 KB, created by
Kyle M Hall (khall)
on 2017-12-21 11:18:42 UTC
(
hide
)
Description:
Bug 19725: Add failing test
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2017-12-21 11:18:42 UTC
Size:
3.32 KB
patch
obsolete
>From 74dfc39e2f1d6065f3bf3ae9abc01796dd3dc498 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 1 Dec 2017 15:18:04 +0000 >Subject: [PATCH] Bug 19725: Add failing test > >Also fix tests for UNIMARC > >Test plan: >1. prove t/db_dependent/OAI/Server.t >2. Verify that it FAILS > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/OAI/Server.t | 48 +++++++++++++++++++++++++++++++++++---------- > 1 file changed, 38 insertions(+), 10 deletions(-) > >diff --git a/t/db_dependent/OAI/Server.t b/t/db_dependent/OAI/Server.t >index 951d7b0..fa2d2a7 100644 >--- a/t/db_dependent/OAI/Server.t >+++ b/t/db_dependent/OAI/Server.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 28; >+use Test::More tests => 29; > use DateTime; > use Test::MockModule; > use Test::Warn; >@@ -89,18 +89,22 @@ foreach my $index ( 0 .. NUMBER_OF_MARC_RECORDS - 1 ) { > $record = GetMarcBiblio({ biblionumber => $biblionumber }); > $record = XMLin($record->as_xml_record); > push @header, { datestamp => $timestamp, identifier => "TEST:$biblionumber" }; >+ my $dc = { >+ 'dc:title' => "Title $index", >+ 'dc:language' => "lng", >+ 'dc:type' => {}, >+ 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', >+ 'xmlns:oai_dc' => 'http://www.openarchives.org/OAI/2.0/oai_dc/', >+ 'xmlns:dc' => 'http://purl.org/dc/elements/1.1/', >+ 'xsi:schemaLocation' => 'http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd', >+ }; >+ if (C4::Context->preference('marcflavour') eq 'UNIMARC') { >+ $dc->{'dc:identifier'} = $biblionumber; >+ } > push @oaidc, { > header => $header[$index], > metadata => { >- 'oai_dc:dc' => { >- 'dc:title' => "Title $index", >- 'dc:language' => "lng", >- 'dc:type' => {}, >- 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', >- 'xmlns:oai_dc' => 'http://www.openarchives.org/OAI/2.0/oai_dc/', >- 'xmlns:dc' => 'http://purl.org/dc/elements/1.1/', >- 'xsi:schemaLocation' => 'http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd', >- }, >+ 'oai_dc:dc' => $dc, > }, > }; > push @marcxml, { >@@ -335,6 +339,30 @@ test_query( > }, > }); > >+subtest 'Bug 19725: OAI-PMH ListRecords and ListIdentifiers should use biblio_metadata.timestamp' => sub { >+ plan tests => 1; >+ >+ # Wait 1 second to be sure no timestamp will be equal to $from defined below >+ sleep 1; >+ >+ my $from_dt = DateTime->now; >+ my $from = $from_dt->ymd . 'T' . $from_dt->hms . 'Z'; >+ >+ # Modify record to trigger auto update of timestamp >+ (my $biblionumber = $marcxml[0]->{header}->{identifier}) =~ s/^.*:(.*)/$1/; >+ my $record = GetMarcBiblio({biblionumber => $biblionumber}); >+ $record->append_fields(MARC::Field->new(999, '', '', z => '_')); >+ ModBiblio($record, $biblionumber); >+ >+ test_query( >+ 'ListRecords oai_dc with parameter from', >+ { verb => 'ListRecords', metadataPrefix => 'oai_dc', from => $from }, >+ { ListRecords => { >+ record => $oaidc[0], >+ }, >+ }); >+}; >+ > $schema->storage->txn_rollback; > > sub manipulate_timestamp { >-- >2.10.2
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 19725
:
69437
|
69438
|
69627
|
69628
| 69997 |
69998