Bugzilla – Attachment 171849 Details for
Bug 37964
Only show host items when system preference EasyAnalyticalRecords is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37964: Add units test
Bug-37964-Add-units-test.patch (text/plain), 1.61 KB, created by
Lucas Gass (lukeg)
on 2024-09-21 15:24:25 UTC
(
hide
)
Description:
Bug 37964: Add units test
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-09-21 15:24:25 UTC
Size:
1.61 KB
patch
obsolete
>From 214b08b126530694278023e8e47889a48a70b931 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 19 Sep 2024 16:44:07 +0200 >Subject: [PATCH] Bug 37964: Add units test > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > t/db_dependent/Koha/Biblio.t | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index 7226421d232..efadda5f374 100755 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -1387,15 +1387,23 @@ subtest 'host_items() tests' => sub { > is( $host_items->count, 0 ); > > subtest 'test host_items param in items()' => sub { >- plan tests => 4; >+ plan tests => 5; >+ >+ t::lib::Mocks::mock_preference( 'EasyAnalyticalRecords', 1 ); > > my $items = $biblio->items; > is( $items->count, 1, "Without host_items param we only get the items on the biblio"); >+ > $items = $biblio->items({ host_items => 1 }); > is( $items->count, 3, "With param host_items we get the biblio items plus analytics"); > is( ref($items), 'Koha::Items', "We correctly get an Items object"); > is_deeply( [ $items->get_column('itemnumber') ], > [ $item_1->itemnumber, $host_item_1->itemnumber, $host_item_2->itemnumber ] ); >+ >+ t::lib::Mocks::mock_preference( 'EasyAnalyticalRecords', 0 ); >+ >+ $items = $biblio->items({ host_items => 1 }); >+ is( $items->count, 1, "With host_items param but EasyAnalyticalRecords disabled we only get the items on the biblio"); > }; > > $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 37964
:
171776
|
171779
|
171848
|
171849
|
171926
|
171927