Bugzilla – Attachment 84960 Details for
Bug 22140
More use of EasyAnalyticalRecords pref
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22140: Larger unit test for get_hostitemnumbers_of
Bug-22140-Larger-unit-test-for-gethostitemnumberso.patch (text/plain), 2.72 KB, created by
Martin Renvoize (ashimema)
on 2019-02-11 10:07:31 UTC
(
hide
)
Description:
Bug 22140: Larger unit test for get_hostitemnumbers_of
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-02-11 10:07:31 UTC
Size:
2.72 KB
patch
obsolete
>From c5b692bd02a15e2a283366353a70a58f6b2262a2 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Wed, 6 Feb 2019 16:10:07 +0100 >Subject: [PATCH] Bug 22140: Larger unit test for get_hostitemnumbers_of > >Add syspref EasyAnalyticalRecords impact in unit test for get_hostitemnumbers_of > >Test plan : >Run t/db_dependent/Items.t > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Items.t | 34 +++++++++++++++++++++++++++------- > 1 file changed, 27 insertions(+), 7 deletions(-) > >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index 5cf8c07e4e..4341de2790 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -813,20 +813,40 @@ subtest '_mod_item_dates' => sub { > }; > > subtest 'get_hostitemnumbers_of' => sub { >- plan tests => 1; >+ plan tests => 3; > > $schema->storage->txn_begin; >+ t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); >+ my $builder = t::lib::TestBuilder->new; > >- my $bib = MARC::Record->new(); >- $bib->append_fields( >+ # Host item field without 0 or 9 >+ my $bib1 = MARC::Record->new(); >+ $bib1->append_fields( > MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'), > MARC::Field->new('245', ' ', ' ', a => 'Silence in the library'), > MARC::Field->new('773', ' ', ' ', b => 'b without 0 or 9'), > ); >- my ($biblionumber, $bibitemnum) = AddBiblio($bib, ''); >- >- my @itemnumbers = C4::Items::get_hostitemnumbers_of( $biblionumber ); >- is( @itemnumbers, 0, ); >+ my ($biblionumber1, $bibitemnum1) = AddBiblio($bib1, ''); >+ my @itemnumbers1 = C4::Items::get_hostitemnumbers_of( $biblionumber1 ); >+ is( scalar @itemnumbers1, 0, '773 without 0 or 9'); >+ >+ # Correct host item field, analytical records on >+ t::lib::Mocks::mock_preference('EasyAnalyticalRecords', 1); >+ my $hostitem = $builder->build_sample_item(); >+ my $bib2 = MARC::Record->new(); >+ $bib2->append_fields( >+ MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'), >+ MARC::Field->new('245', ' ', ' ', a => 'Silence in the library'), >+ MARC::Field->new('773', ' ', ' ', 0 => $hostitem->biblionumber , 9 => $hostitem->itemnumber, b => 'b' ), >+ ); >+ my ($biblionumber2, $bibitemnum2) = AddBiblio($bib2, ''); >+ my @itemnumbers2 = C4::Items::get_hostitemnumbers_of( $biblionumber2 ); >+ is( scalar @itemnumbers2, 1, '773 with 0 and 9, EasyAnalyticalRecords on'); >+ >+ # Correct host item field, analytical records off >+ t::lib::Mocks::mock_preference('EasyAnalyticalRecords', 0); >+ @itemnumbers2 = C4::Items::get_hostitemnumbers_of( $biblionumber2 ); >+ is( scalar @itemnumbers2, 0, '773 with 0 and 9, EasyAnalyticalRecords off'); > > $schema->storage->txn_rollback; > }; >-- >2.20.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 22140
:
84060
|
84820
|
84822
|
84828
|
84958
|
84959
|
84960
|
85143
|
85144
|
85145