Bugzilla – Attachment 174814 Details for
Bug 37334
Cannot filter holdings table by status
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37334: Add filter_by_checked_out tests
Bug-37334-Add-filterbycheckedout-tests.patch (text/plain), 1.90 KB, created by
Lucas Gass (lukeg)
on 2024-11-19 23:24:32 UTC
(
hide
)
Description:
Bug 37334: Add filter_by_checked_out tests
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-11-19 23:24:32 UTC
Size:
1.90 KB
patch
obsolete
>From 3336806b05442e761f3d8a763fc8bcb6806c7e1e Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 19 Nov 2024 23:23:14 +0000 >Subject: [PATCH] Bug 37334: Add filter_by_checked_out tests > >--- > t/db_dependent/Koha/Items.t | 35 ++++++++++++++++++++++++++++++++++- > 1 file changed, 34 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t >index 03b26550eb..c984c00260 100755 >--- a/t/db_dependent/Koha/Items.t >+++ b/t/db_dependent/Koha/Items.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 20; >+use Test::More tests => 21; > > use Test::MockModule; > use Test::Exception; >@@ -2222,3 +2222,36 @@ subtest 'filter_by_bookable' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'filter_by_checked_out' => sub { >+ plan tests => 4; >+ >+ $schema->storage->txn_begin; >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ t::lib::Mocks::mock_userenv( { branchcode => $patron->branchcode } ); >+ >+ my $biblio = $builder->build_sample_biblio(); >+ my $item_1 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber, }); >+ my $item_2 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber, }); >+ >+ is( $biblio->items->filter_by_checked_out->count, 0, "Filtered 0 checked out items" ); >+ >+ C4::Circulation::AddIssue( $patron, $item_1->barcode ); >+ >+ is( $biblio->items->filter_by_checked_out->count, 1, "Filtered 1 checked out items" ); >+ >+ C4::Circulation::AddIssue( $patron, $item_2->barcode ); >+ >+ is( $biblio->items->filter_by_checked_out->count, 2, "Filtered 2 checked out items" ); >+ >+ # Do the returns >+ C4::Circulation::AddReturn( $item_1->barcode ); >+ C4::Circulation::AddReturn( $item_2->barcode ); >+ >+ is( $biblio->items->filter_by_checked_out->count, 0, "Filtered 0 checked out items" ); >+ >+ $schema->storage->txn_rollback; >+ >+}; >+ >-- >2.39.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 37334
:
172300
|
172301
|
172302
|
173499
|
173500
|
173501
|
173949
|
173950
|
173951
|
173982
|
174310
|
174798
|
174799
|
174800
|
174801
|
174802
|
174803
|
174804
|
174813
|
174814
|
174901
|
174902
|
174903
|
174955
|
175859
|
175860
|
175861
|
175862
|
175863
|
175864
|
175865
|
175866
|
175867
|
175868
|
175869
|
175870
|
175871
|
175999
|
176000
|
176001
|
176002
|
176003
|
176004
|
176005
|
176006
|
176007
|
176008
|
176009
|
176010
|
176011
|
176023
|
176024
|
176025
|
176026
|
176027
|
176028
|
176029
|
176030
|
176031
|
176032
|
176033
|
176034
|
176035
|
176475
|
176477
|
176480
|
176481
|
177321
|
177415
|
177416
|
177417
|
177418
|
177419
|
177420
|
177421
|
177422
|
177423
|
177424
|
177425
|
177426
|
177427
|
177428
|
177429
|
177430
|
177431
|
177432