Bugzilla – Attachment 134996 Details for
Bug 29719
onloan dates are cleared from items when importing and overlaying
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29719: Unit tests
Bug-29719-Unit-tests.patch (text/plain), 1.99 KB, created by
Martin Renvoize (ashimema)
on 2022-05-14 07:57:50 UTC
(
hide
)
Description:
Bug 29719: Unit tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-05-14 07:57:50 UTC
Size:
1.99 KB
patch
obsolete
>From 7cf1e0be48d8807acc09f6017c2e94143691b6e7 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 14 Jan 2022 19:59:07 +0000 >Subject: [PATCH] Bug 29719: Unit tests > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Items.t | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index ab0fa8e66e..3b5c622a3d 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -1019,7 +1019,7 @@ subtest 'Split subfields in Item2Marc (Bug 21774)' => sub { > }; > > subtest 'ModItemFromMarc' => sub { >- plan tests => 6; >+ plan tests => 7; > $schema->storage->txn_begin; > > my $builder = t::lib::TestBuilder->new; >@@ -1075,6 +1075,24 @@ subtest 'ModItemFromMarc' => sub { > is( $item->get_from_storage->cn_sort, 'YYY', 'cn_sort has been updated' ); > }; > >+ subtest 'onloan' => sub { >+ plan tests => 3; >+ >+ my $item = $builder->build_sample_item; >+ $item->set({ onloan => '2022-03-19' })->store; >+ is( $item->onloan, '2022-03-19', 'init values set are expected' ); >+ >+ my $marc = C4::Items::Item2Marc( $item->get_from_storage->unblessed, $item->biblionumber ); >+ my ( $MARCfield, $MARCsubfield ) = GetMarcFromKohaField( 'items.onloan' ); >+ $marc->field($MARCfield)->delete_subfield( code => $MARCsubfield ); >+ ModItemFromMarc( $marc, $item->biblionumber, $item->itemnumber ); >+ is( $item->get_from_storage->onloan, '2022-03-19', 'onloan has not been updated if not passed' ); >+ >+ $marc = C4::Items::Item2Marc( { %{$item->unblessed}, onloan => '2022-03-26' }, $item->biblionumber ); >+ ModItemFromMarc( $marc, $item->biblionumber, $item->itemnumber ); >+ is( $item->get_from_storage->onloan, '2022-03-26', 'onloan has been updated when passed in' ); >+ }; >+ > subtest 'permanent_location' => sub { > plan tests => 10; > >-- >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 29719
:
128635
|
128636
|
129515
|
129516
|
134662
|
134663
| 134996 |
134997