Bugzilla – Attachment 161054 Details for
Bug 32029
Automatic item modifications by age missing biblio table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32029: (follow-up) unit test
Bug-32029-follow-up-unit-test.patch (text/plain), 2.34 KB, created by
Fridolin Somers
on 2024-01-16 08:47:54 UTC
(
hide
)
Description:
Bug 32029: (follow-up) unit test
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2024-01-16 08:47:54 UTC
Size:
2.34 KB
patch
obsolete
>From ada3b5fcfa7f40e5d8514f763b729aa8de197995 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Mon, 4 Dec 2023 20:09:50 -1000 >Subject: [PATCH] Bug 32029: (follow-up) unit test > >Signed-off-by: matthias le gac <matthias.le-gac@inlibro.com> >--- > .../Items/AutomaticItemModificationByAge.t | 29 +++++++++++++++++-- > 1 file changed, 27 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Items/AutomaticItemModificationByAge.t b/t/db_dependent/Items/AutomaticItemModificationByAge.t >index 60507a478a..51b98f9489 100755 >--- a/t/db_dependent/Items/AutomaticItemModificationByAge.t >+++ b/t/db_dependent/Items/AutomaticItemModificationByAge.t >@@ -1,7 +1,7 @@ > #!/usr/bin/perl > > use Modern::Perl; >-use Test::More tests => 19; >+use Test::More tests => 20; > use MARC::Record; > use MARC::Field; > use DateTime; >@@ -47,7 +47,7 @@ $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); > my $record = MARC::Record->new(); > $record->append_fields( > MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'), >- MARC::Field->new('245', ' ', ' ', a => 'Silence in the library'), >+ MARC::Field->new('245', ' ', ' ', a => 'Silence in the library', h => 'Book'), > MARC::Field->new('942', ' ', ' ', c => 'ITEMTYPE_T'), > ); > my ($biblionumber, undef) = C4::Biblio::AddBiblio($record, $frameworkcode); >@@ -330,6 +330,31 @@ C4::Items::ToggleNewStatus( { rules => \@rules } ); > $modified_item = Koha::Items->find( $itemnumber ); > is( $modified_item->new_status, 'agefield_new_value', q|ToggleNewStatus: Age = 2, agefield = 'items.datelastseen' : The new_status value is updated|); > >+# Condition on biblio column >+@rules = ( >+ { >+ # does not exist >+ conditions => [ >+ { >+ field => 'biblio.medium', >+ value => 'Book', >+ }, >+ ], >+ substitutions => [ >+ { >+ field => 'items.new_status', >+ value => 'new_updated_value_biblio', >+ }, >+ ], >+ age => '0', >+ }, >+); >+ >+C4::Items::ToggleNewStatus( { rules => \@rules } ); >+ >+$modified_item = Koha::Items->find( $itemnumber ); >+is( $modified_item->new_status, 'new_updated_value_biblio', q|ToggleNewStatus: conditions on biblio|); >+ > # Run twice > t::lib::Mocks::mock_preference('CataloguingLog', 1); > my $actions_nb = $schema->resultset('ActionLog')->count(); >-- >2.43.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 32029
:
142752
|
151073
|
159574
|
159575
|
160977
|
161053
|
161054
|
161055
|
161489