Bugzilla – Attachment 37554 Details for
Bug 6520
Items don't display when viewing staged records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 6520: Add unit test for C4::ImportBatch::GetRecordFromImportBiblio
PASSED-QA-Bug-6520-Add-unit-test-for-C4ImportBatch.patch (text/plain), 3.01 KB, created by
Katrin Fischer
on 2015-04-07 20:13:39 UTC
(
hide
)
Description:
[PASSED QA] Bug 6520: Add unit test for C4::ImportBatch::GetRecordFromImportBiblio
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2015-04-07 20:13:39 UTC
Size:
3.01 KB
patch
obsolete
>From 1d46921cbeacb7afc55b80ee39fb6692e9b76752 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 7 Apr 2015 12:29:53 +0200 >Subject: [PATCH] [PASSED QA] Bug 6520: Add unit test for > C4::ImportBatch::GetRecordFromImportBiblio > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > t/db_dependent/ImportBatch.t | 49 +++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 48 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/ImportBatch.t b/t/db_dependent/ImportBatch.t >index 95e20cd..661cd33 100644 >--- a/t/db_dependent/ImportBatch.t >+++ b/t/db_dependent/ImportBatch.t >@@ -4,7 +4,7 @@ use Modern::Perl; > > use C4::Context; > >-use Test::More tests => 5; >+use Test::More tests => 7; > > BEGIN { > use_ok('C4::ImportBatch'); >@@ -70,3 +70,50 @@ delete $importbatch1->{num_items}; > > is_deeply( $importbatch1, $sample_import_batch1, > "GetImportBatch returns the right informations about $sample_import_batch1" ); >+ >+my $record = MARC::Record->new; >+# FIXME Create another MARC::Record which won't be modified >+# AddItemsToImportBiblio will remove the items field from the record passed in parameter. >+my $original_record = MARC::Record->new; >+$record->leader('03174nam a2200445 a 4500'); >+$original_record->leader('03174nam a2200445 a 4500'); >+my ($item_tag, $item_subfield) = C4::Biblio::GetMarcFromKohaField('items.itemnumber',''); >+my @fields = ( >+ MARC::Field->new( >+ 100, '1', ' ', >+ a => 'Knuth, Donald Ervin', >+ d => '1938', >+ ), >+ MARC::Field->new( >+ 245, '1', '4', >+ a => 'The art of computer programming', >+ c => 'Donald E. Knuth.', >+ ), >+ MARC::Field->new( >+ 650, ' ', '0', >+ a => 'Computer programming.', >+ 9 => '462', >+ ), >+ MARC::Field->new( >+ $item_tag, ' ', ' ', >+ e => 'my edition', >+ i => 'my item part', >+ ), >+ MARC::Field->new( >+ $item_tag, ' ', ' ', >+ e => 'my edition 2', >+ i => 'my item part 2', >+ ), >+); >+$record->append_fields(@fields); >+$original_record->append_fields(@fields); >+my $import_record_id = AddBiblioToBatch( $id_import_batch1, 0, $record, 'utf8', int(rand(99999)), 0 ); >+AddItemsToImportBiblio( $id_import_batch1, $import_record_id, $record, 0 ); >+ >+my $record_from_import_biblio_with_items = C4::ImportBatch::GetRecordFromImportBiblio( $import_record_id, 'embed_items' ); >+$original_record->leader($record_from_import_biblio_with_items->leader()); >+is_deeply( $record_from_import_biblio_with_items, $original_record, 'GetRecordFromImportBiblio should return the record with items if specified' ); >+$original_record->delete_fields($original_record->field($item_tag)); #Remove items fields >+my $record_from_import_biblio_without_items = C4::ImportBatch::GetRecordFromImportBiblio( $import_record_id ); >+$original_record->leader($record_from_import_biblio_without_items->leader()); >+is_deeply( $record_from_import_biblio_without_items, $original_record, 'GetRecordFromImportBiblio should return the record without items by default' ); >-- >1.9.1
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 6520
:
37310
|
37311
|
37344
|
37540
|
37544
|
37552
|
37553
| 37554