Bugzilla – Attachment 171927 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.76 KB, created by
Jonathan Druart
on 2024-09-24 12:44:58 UTC
(
hide
)
Description:
Bug 37964: Add units test
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-09-24 12:44:58 UTC
Size:
1.76 KB
patch
obsolete
>From 08703a75399623d526301d0e448a4e2a0a2cb27d 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> > >Amended-by: Jonathan Druart >Tidy > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Koha/Biblio.t | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index 7226421d232..6af083b2762 100755 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -1387,15 +1387,26 @@ 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.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 37964
:
171776
|
171779
|
171848
|
171849
|
171926
| 171927