Bugzilla – Attachment 154895 Details for
Bug 34639
Item shown in transit on detail.pl even if marked as arrived or cancelled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34639: (DO NOT PUSH) Add tests
Bug-34639-DO-NOT-PUSH-Add-tests.patch (text/plain), 2.55 KB, created by
Lari Taskula
on 2023-08-29 09:45:27 UTC
(
hide
)
Description:
Bug 34639: (DO NOT PUSH) Add tests
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2023-08-29 09:45:27 UTC
Size:
2.55 KB
patch
obsolete
>From 2fa2986929cc30879c902066830b3910d6faf7c6 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Tue, 29 Aug 2023 09:34:04 +0000 >Subject: [PATCH] Bug 34639: (DO NOT PUSH) Add tests > >To reproduce: > >1. Add an item to library A >2. Go to Circulation -> Transfer >3. Transfer the item from library A to another library B >4. Set your currently logged in library to library B >5. Check-in the item >6. Observe message "Item received from A" >7. View the bibliographic record of the item (catalogue/detail.pl) >8. Observe item in "In transit from A to B since xx/xx/xxxx Available" > >To test: >1. prove t/db_dependent/Koha/Item/Transfer.t >--- > t/db_dependent/Koha/Item/Transfer.t | 39 ++++++++++++++++++++++++++++- > 1 file changed, 38 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Item/Transfer.t b/t/db_dependent/Koha/Item/Transfer.t >index 2ac3462351..80cd387376 100755 >--- a/t/db_dependent/Koha/Item/Transfer.t >+++ b/t/db_dependent/Koha/Item/Transfer.t >@@ -24,12 +24,49 @@ use Koha::DateUtils qw( dt_from_string ); > > use t::lib::TestBuilder; > >-use Test::More tests => 7; >+use Test::More tests => 8; > use Test::Exception; > > my $schema = Koha::Database->new->schema; > my $builder = t::lib::TestBuilder->new; > >+subtest 'detail.tt correctly in transit' => sub { >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $item = $builder->build_sample_item(); >+ my $transfer = $builder->build_object( >+ { >+ class => 'Koha::Item::Transfers', >+ value => { >+ itemnumber => $item->itemnumber, >+ datesent => dt_from_string, >+ datearrived => dt_from_string, >+ } >+ } >+ ); >+ >+ my $transfer_item = $transfer->item; >+ my $biblio = Koha::Biblios->find($transfer_item->biblionumber); >+ >+ my $items_params = {}; >+ my $params = {}; >+ >+ # FROM catalogue/detail.pl >+ my $items = $biblio->items($items_params)->search_ordered( $params, { prefetch => ['issue','current_branchtransfers'] } ); >+ # but minimum testable case would be >+ #my $items = Koha::Items->search( { 'me.itemnumber' => $transfer_item->itemnumber }, { prefetch => ['current_branchtransfers'] } ); >+ >+ my $detail_tt_item = $items->next; >+ >+ # following two tests should produce the same result >+ is($transfer_item->get_transfer, undef, 'Koha::Item->get_transfer returns undef'); >+ is($detail_tt_item->get_transfer, undef, 'detail.tt->get_transfer returns undef'); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'item relation tests' => sub { > plan tests => 2; > >-- >2.34.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 34639
:
154895
|
154896
|
154900
|
154917
|
154918
|
154919
|
154939
|
154940
|
154941
|
155127
|
155128
|
155129
|
155211
|
155212
|
155213
|
155236
|
155237
|
155238