Bugzilla – Attachment 191556 Details for
Bug 41649
Add support for setting the magnetic media flag for SIP in Koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41649: Unit tests for magnetic media
ba470fa.patch (text/plain), 2.68 KB, created by
Martin Renvoize (ashimema)
on 2026-01-16 08:17:28 UTC
(
hide
)
Description:
Bug 41649: Unit tests for magnetic media
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-01-16 08:17:28 UTC
Size:
2.68 KB
patch
obsolete
>From ba470faa8d7e6044bb4d66452c718b0595b532c1 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Fri, 16 Jan 2026 08:13:35 +0000 >Subject: [PATCH] Bug 41649: Unit tests for magnetic media > >Add unit tests for SIP magnetic media support. > >Test plan >1) Run t/db_dependent/SIP/Transaction.t in ktd and confirm it passes >--- > t/db_dependent/SIP/Transaction.t | 53 +++++++++++++++++++++++++++++++- > 1 file changed, 52 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t >index 1d91c693ab5..5232bcad739 100755 >--- a/t/db_dependent/SIP/Transaction.t >+++ b/t/db_dependent/SIP/Transaction.t >@@ -5,7 +5,7 @@ > > use Modern::Perl; > use Test::NoWarnings; >-use Test::More tests => 22; >+use Test::More tests => 23; > use Test::Warn; > > use DateTime; >@@ -1643,4 +1643,55 @@ subtest 'Checkin message' => sub { > is( $circ->{screen_msg}, '', "Checked out item was checked out to the next patron" ); > }; > >+subtest 'magnetic_media flag from item type' => sub { >+ plan tests => 4; >+ >+ # Create an item type with magnetic = 1 >+ my $itemtype_magnetic = $builder->build_object( >+ { >+ class => 'Koha::ItemTypes', >+ value => { >+ itemtype => 'MAGNETIC', >+ description => 'Magnetic Test Item Type', >+ sip_magnetic => 1, >+ } >+ } >+ ); >+ >+ # Create an item type with magnetic = 0 >+ my $itemtype_non_magnetic = $builder->build_object( >+ { >+ class => 'Koha::ItemTypes', >+ value => { >+ itemtype => 'NONMAG', >+ description => 'Non-Magnetic Test Item Type', >+ sip_magnetic => 0, >+ } >+ } >+ ); >+ >+ # Create items with these types >+ my $item_magnetic = $builder->build_sample_item( >+ { >+ itype => $itemtype_magnetic->itemtype, >+ } >+ ); >+ >+ my $item_non_magnetic = $builder->build_sample_item( >+ { >+ itype => $itemtype_non_magnetic->itemtype, >+ } >+ ); >+ >+ # Test magnetic item >+ my $sip_item_magnetic = C4::SIP::ILS::Item->new( $item_magnetic->barcode ); >+ ok( defined $sip_item_magnetic, 'SIP Item object created for magnetic item' ); >+ is( $sip_item_magnetic->magnetic_media, 1, 'magnetic_media is 1 for magnetic item type' ); >+ >+ # Test non-magnetic item >+ my $sip_item_non_magnetic = C4::SIP::ILS::Item->new( $item_non_magnetic->barcode ); >+ ok( defined $sip_item_non_magnetic, 'SIP Item object created for non-magnetic item' ); >+ is( $sip_item_non_magnetic->magnetic_media, 0, 'magnetic_media is 0 for non-magnetic item type' ); >+}; >+ > $schema->storage->txn_rollback; >-- >2.52.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 41649
:
191552
|
191553
|
191554
|
191555
| 191556