Bugzilla – Attachment 70058 Details for
Bug 18201
Export data -Fix "Remove non-local items" option and add "Removes non-local records" option for existing functionality
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18201: Tidy tests
Bug-18201-Tidy-tests.patch (text/plain), 4.95 KB, created by
Jonathan Druart
on 2017-12-21 15:43:16 UTC
(
hide
)
Description:
Bug 18201: Tidy tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-12-21 15:43:16 UTC
Size:
4.95 KB
patch
obsolete
>From 343f158fce3f4ee189d81042b8dfc41ee06a457d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 21 Dec 2017 12:37:38 -0300 >Subject: [PATCH] Bug 18201: Tidy tests > >--- > t/db_dependent/Exporter/Record.t | 98 +++++++++++++++++++++------------------- > 1 file changed, 52 insertions(+), 46 deletions(-) > >diff --git a/t/db_dependent/Exporter/Record.t b/t/db_dependent/Exporter/Record.t >index 6b166ee3eb..3dc25d6afb 100644 >--- a/t/db_dependent/Exporter/Record.t >+++ b/t/db_dependent/Exporter/Record.t >@@ -217,61 +217,67 @@ subtest '_get_biblio_for_export' => sub { > my $biblio = MARC::Record->new(); > $biblio->leader('00266nam a22001097a 4500'); > $biblio->append_fields( >- MARC::Field->new('100', ' ', ' ', a => 'Thurber, James'), >- MARC::Field->new('245', ' ', ' ', a => "The 13 Clocks"), >+ MARC::Field->new( '100', ' ', ' ', a => 'Thurber, James' ), >+ MARC::Field->new( '245', ' ', ' ', a => "The 13 Clocks" ), > ); >- my ($biblionumber, $biblioitemnumber) = AddBiblio($biblio, ''); >- my $branch_a = $builder->build({ >- source => 'Branch', >- value => { >- } >- }); >- my $branch_b = $builder->build({ >- source => 'Branch', >- value => { >- } >- }); >- my $item_branch_a = $builder->build({ >- source => 'Item', >- value => { >- biblionumber => $biblionumber, >- homebranch => $branch_a->{branchcode}, >- more_subfields_xml => '', >+ my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $biblio, '' ); >+ my $branch_a = $builder->build({source => 'Branch',}); >+ my $branch_b = $builder->build({source => 'Branch',}); >+ my $item_branch_a = $builder->build( >+ { >+ source => 'Item', >+ value => { >+ biblionumber => $biblionumber, >+ homebranch => $branch_a->{branchcode}, >+ more_subfields_xml => '', >+ } > } >- }); >- my $item_branch_b = $builder->build({ >- source => 'Item', >- value => { >- biblionumber => $biblionumber, >- homebranch => $branch_b->{branchcode}, >- more_subfields_xml => '', >+ ); >+ my $item_branch_b = $builder->build( >+ { >+ source => 'Item', >+ value => { >+ biblionumber => $biblionumber, >+ homebranch => $branch_b->{branchcode}, >+ more_subfields_xml => '', >+ } > } >- }); >+ ); > >- my $record = Koha::Exporter::Record::_get_biblio_for_export( { >- biblionumber => $biblionumber, >- export_items => 1, >- only_export_items_for_branches => undef >- }); >+ my $record = Koha::Exporter::Record::_get_biblio_for_export( >+ { >+ biblionumber => $biblionumber, >+ export_items => 1, >+ only_export_items_for_branches => undef >+ } >+ ); > my @items = $record->field('952'); >- is(scalar @items,2,"We should retrieve all items if we don't pass specific branches and request items"); >+ is( scalar @items, 2, "We should retrieve all items if we don't pass specific branches and request items" ); > >- $record = Koha::Exporter::Record::_get_biblio_for_export( { >- biblionumber => $biblionumber, >- export_items => 1, >- only_export_items_for_branches => [$branch_b->{branchcode}] >- }); >+ $record = Koha::Exporter::Record::_get_biblio_for_export( >+ { >+ biblionumber => $biblionumber, >+ export_items => 1, >+ only_export_items_for_branches => [ $branch_b->{branchcode} ] >+ } >+ ); > @items = $record->field('952'); >- is(scalar @items,1,"We should retrieve only item for branch_b item if we request items and pass branch"); >- is($items[0]->subfield('a'),$branch_b->{branchcode},"And the homebranch for that item should be branch_b branchcode"); >+ is( scalar @items, 1, "We should retrieve only item for branch_b item if we request items and pass branch" ); >+ is( >+ $items[0]->subfield('a'), >+ $branch_b->{branchcode}, >+ "And the homebranch for that item should be branch_b branchcode" >+ ); > >- $record = Koha::Exporter::Record::_get_biblio_for_export( { >- biblionumber => $biblionumber, >- export_items => 0, >- only_export_items_for_branches => [$branch_b->{branchcode}] >- }); >+ $record = Koha::Exporter::Record::_get_biblio_for_export( >+ { >+ biblionumber => $biblionumber, >+ export_items => 0, >+ only_export_items_for_branches => [ $branch_b->{branchcode} ] >+ } >+ ); > @items = $record->field('952'); >- is(@items,0,"We should not have any items if we don't request items and pass a branch"); >+ is( scalar @items, 0, "We should not have any items if we don't request items and pass a branch"); > > }; > >-- >2.11.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 18201
:
62149
|
62152
|
66412
|
67596
|
67597
|
68499
|
68500
|
70002
|
70003
| 70058