Bugzilla – Attachment 144692 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), 1.99 KB, created by
Nick Clemens
on 2022-12-16 15:48:23 UTC
(
hide
)
Description:
Bug 32456: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2022-12-16 15:48:23 UTC
Size:
1.99 KB
patch
obsolete
>From 12e87954e5992096d9fa41db243611bee48d145c 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 > >--- > 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 3f8bb8fd62..8dec62ca20 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.30.2
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