Bugzilla – Attachment 114155 Details for
Bug 27149
Z3950Responder removes itemnumber when adding item statuses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27149: Unit tests
Bug-27149-Unit-tests.patch (text/plain), 3.17 KB, created by
Nick Clemens
on 2020-12-03 17:09:29 UTC
(
hide
)
Description:
Bug 27149: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2020-12-03 17:09:29 UTC
Size:
3.17 KB
patch
obsolete
>From eaab9bafd1638010ff4c6b41c489b21290260788 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 3 Dec 2020 17:03:40 +0000 >Subject: [PATCH] Bug 27149: Unit tests > >--- > t/db_dependent/Koha/Z3950Responder/Session.t | 47 +++++++++++++--------------- > 1 file changed, 22 insertions(+), 25 deletions(-) > >diff --git a/t/db_dependent/Koha/Z3950Responder/Session.t b/t/db_dependent/Koha/Z3950Responder/Session.t >index 33bfd4f527..6ac8771d75 100644 >--- a/t/db_dependent/Koha/Z3950Responder/Session.t >+++ b/t/db_dependent/Koha/Z3950Responder/Session.t >@@ -17,38 +17,33 @@ $schema->storage->txn_begin; > > subtest 'add_item_status' => sub { > >- plan tests => 2; >+ plan tests => 3; > > ## FIRST ITEM HAS ALL THE STATUSES ## >- my $item_1 = $builder->build({ >- source => 'Item', >- value => { >- onloan => '2017-07-07', >- itemlost => 1, >- notforloan => 1, >- damaged => 1, >- withdrawn => 1, >- } >+ my $item_1 = $builder->build_sample_item({ >+ onloan => '2017-07-07', >+ itemlost => 1, >+ notforloan => 1, >+ damaged => 1, >+ withdrawn => 1, > }); >- my $item_marc_1 = C4::Items::GetMarcItem( $item_1->{biblionumber}, $item_1->{itemnumber} ); >- my $item_field_1 = scalar $item_marc_1->field('952'); >- $builder->build({ source => 'Reserve', value=> { itemnumber => $item_1->{itemnumber} } }); >- $builder->build({ source => 'Branchtransfer', value=> { itemnumber => $item_1->{itemnumber}, datearrived => undef } }); >+ my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber" ); >+ my $item_marc_1 = C4::Items::GetMarcItem( $item_1->biblionumber, $item_1->itemnumber ); >+ my $item_field_1 = scalar $item_marc_1->field($itemtag); >+ $builder->build({ source => 'Reserve', value=> { itemnumber => $item_1->itemnumber } }); >+ $builder->build({ source => 'Branchtransfer', value=> { itemnumber => $item_1->itemnumber, datearrived => undef } }); > ## END FIRST ITEM ## > > ## SECOND ITEM HAS NO STATUSES ## >- my $item_2 = $builder->build({ >- source => 'Item', >- value => { >- onloan => undef, >- itemlost => 0, >- notforloan => 0, >- damaged => 0, >- withdrawn => 0, >- } >+ my $item_2 = $builder->build_sample_item({ >+ onloan => undef, >+ itemlost => 0, >+ notforloan => 0, >+ damaged => 0, >+ withdrawn => 0, > }); >- my $item_marc_2 = C4::Items::GetMarcItem( $item_2->{biblionumber}, $item_2->{itemnumber} ); >- my $item_field_2 = scalar $item_marc_2->field('952'); >+ my $item_marc_2 = C4::Items::GetMarcItem( $item_2->biblionumber, $item_2->itemnumber ); >+ my $item_field_2 = scalar $item_marc_2->field($itemtag); > ## END SECOND ITEM ## > > # Create the responder >@@ -62,6 +57,8 @@ subtest 'add_item_status' => sub { > $args->{HANDLE}->add_item_status($item_field_2); > is($item_field_2->subfield('k'),'Available',"Available status added as expected"); > >+ is($item_field_2->subfield( $itemsubfield ), $item_2->itemnumber, "Itemnumber not removed when status added"); >+ > }; > > $schema->storage->txn_rollback; >-- >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 27149
:
114155
|
114156
|
114230
|
114231
|
114320
|
114321
|
115017
|
115018
|
115063