Bugzilla – Attachment 144740 Details for
Bug 32456
Date accessioned is now cleared when items are replaced
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32456: Unit tests
Bug-32456-Unit-tests.patch (text/plain), 2.06 KB, created by
Martin Renvoize (ashimema)
on 2022-12-20 14:54:54 UTC
(
hide
)
Description:
Bug 32456: Unit tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-12-20 14:54:54 UTC
Size:
2.06 KB
patch
obsolete
>From 2cc5eb74595cba24b0fec977df1944e3932c45b8 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 16 Dec 2022 15:46:48 +0000 >Subject: [PATCH] Bug 32456: Unit tests > >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 3f8bb8fd62d..8dec62ca202 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -766,7 +766,7 @@ subtest 'Split subfields in Item2Marc (Bug 21774)' => sub { > }; > > subtest 'ModItemFromMarc' => sub { >- plan tests => 7; >+ plan tests => 8; > $schema->storage->txn_begin; > > my $builder = t::lib::TestBuilder->new; >@@ -840,6 +840,24 @@ subtest 'ModItemFromMarc' => sub { > is( $item->get_from_storage->onloan, '2022-03-26', 'onloan has been updated when passed in' ); > }; > >+ subtest 'dateaccessioned' => sub { >+ plan tests => 3; >+ >+ my $item = $builder->build_sample_item; >+ $item->set({ dateaccessioned => '2022-03-19' })->store->discard_changes; >+ is( $item->dateaccessioned, '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.dateaccessioned' ); >+ $marc->field($MARCfield)->delete_subfield( code => $MARCsubfield ); >+ ModItemFromMarc( $marc, $item->biblionumber, $item->itemnumber ); >+ is( $item->get_from_storage->dateaccessioned, '2022-03-19', 'dateaccessioned has not been updated if not passed' ); >+ >+ $marc = C4::Items::Item2Marc( { %{$item->unblessed}, dateaccessioned => '2022-03-26' }, $item->biblionumber ); >+ ModItemFromMarc( $marc, $item->biblionumber, $item->itemnumber ); >+ is( $item->get_from_storage->dateaccessioned, '2022-03-26', 'dateaccessioned has been updated when passed in' ); >+ }; >+ > subtest 'permanent_location' => sub { > plan tests => 10; > >-- >2.39.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 32456
:
144553
|
144593
|
144637
|
144692
|
144693
| 144740 |
144741
|
144851