Bugzilla – Attachment 152100 Details for
Bug 30825
Get rid of GetReservesControlBranch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30825: Add unit tests
Bug-30825-Add-unit-tests.patch (text/plain), 1.72 KB, created by
Jonathan Druart
on 2023-06-07 12:32:08 UTC
(
hide
)
Description:
Bug 30825: Add unit tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-06-07 12:32:08 UTC
Size:
1.72 KB
patch
obsolete
>From 3525912418eab7735156621d8cc6d890c4ff0482 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 20 May 2022 11:45:54 -0300 >Subject: [PATCH] Bug 30825: Add unit tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Koha/Item.t | 25 ++++++++++++++++++++++++- > 1 file changed, 24 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index 283cb6e6869..b04202165ec 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -20,7 +20,7 @@ > use Modern::Perl; > use utf8; > >-use Test::More tests => 29; >+use Test::More tests => 30; > use Test::Exception; > use Test::MockModule; > >@@ -2211,3 +2211,26 @@ subtest 'current_branchtransfers relationship' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'holds_control_library() tests' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $library_1 = $builder->build_object({ class => 'Koha::Libraries' }); >+ my $library_2 = $builder->build_object({ class => 'Koha::Libraries' }); >+ >+ my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { branchcode => $library_1->id } }); >+ my $item = $builder->build_sample_item({ library => $library_2->id }); >+ >+ t::lib::Mocks::mock_preference( 'ReservesControlBranch', 'ItemHomeLibrary' ); >+ >+ is( $item->holds_control_library( $patron ), $library_2->id ); >+ >+ t::lib::Mocks::mock_preference( 'ReservesControlBranch', 'PatronLibrary' ); >+ >+ is( $item->holds_control_library( $patron ), $library_1->id ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.25.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 30825
:
135248
|
135249
|
135250
|
135275
|
135276
|
135277
|
135281
|
135488
|
135489
|
135490
|
152100
|
152101
|
152102
|
152103
|
152104
|
155820
|
155821
|
155822
|
155823
|
155824
|
155825
|
155826
|
155827