Bugzilla – Attachment 174573 Details for
Bug 33641
We should record return library in old checkouts (oldissues)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33641: (Follow-up) Fix unit tests
Bug-33641-Follow-up-Fix-unit-tests.patch (text/plain), 2.71 KB, created by
Matt Blenkinsop
on 2024-11-15 11:31:15 UTC
(
hide
)
Description:
Bug 33641: (Follow-up) Fix unit tests
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-11-15 11:31:15 UTC
Size:
2.71 KB
patch
obsolete
>From c337422a8e2a0906f717602a8cd094873a58f03f Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Fri, 15 Nov 2024 11:19:12 +0000 >Subject: [PATCH] Bug 33641: (Follow-up) Fix unit tests > >--- > t/db_dependent/Circulation/StoreLastBorrower.t | 7 +++++-- > t/db_dependent/Koha/Account/Line.t | 3 +-- > t/db_dependent/Koha/Checkouts.t | 2 ++ > 3 files changed, 8 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Circulation/StoreLastBorrower.t b/t/db_dependent/Circulation/StoreLastBorrower.t >index c3121bb954d..c4c7f37a225 100755 >--- a/t/db_dependent/Circulation/StoreLastBorrower.t >+++ b/t/db_dependent/Circulation/StoreLastBorrower.t >@@ -38,10 +38,11 @@ subtest 'Test StoreLastBorrower' => sub { > > t::lib::Mocks::mock_preference( 'StoreLastBorrower', '1' ); > >- my $patron = $builder->build( >+ my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $patron = $builder->build( > { > source => 'Borrower', >- value => { privacy => 1, } >+ value => { privacy => 1, branchcode => $library->branchcode } > } > ); > >@@ -57,6 +58,8 @@ subtest 'Test StoreLastBorrower' => sub { > } > ); > >+ t::lib::Mocks::mock_userenv( { branchcode => $library->branchcode } ); >+ > $item = $item->get_from_storage; > my $patron_object = $item->last_returned_by(); > is( $patron_object, undef, 'Koha::Item::last_returned_by returned undef' ); >diff --git a/t/db_dependent/Koha/Account/Line.t b/t/db_dependent/Koha/Account/Line.t >index 229bae28d4b..20c9e64afa9 100755 >--- a/t/db_dependent/Koha/Account/Line.t >+++ b/t/db_dependent/Koha/Account/Line.t >@@ -394,6 +394,7 @@ subtest 'apply() tests' => sub { > is( $messages[0]->payload->{success}, 1, "'success' key in payload" ); > > t::lib::Mocks::mock_preference( 'MarkLostItemsAsReturned', 'onpayment'); >+ t::lib::Mocks::mock_userenv( { branchcode => $library->id } ); > my $loser = $builder->build_object( { class => 'Koha::Patrons' } ); > my $loser_account = $loser->account; > >@@ -443,8 +444,6 @@ subtest 'apply() tests' => sub { > > is( $loser->checkouts->next, undef, "Item has been returned"); > >- >- > $schema->storage->txn_rollback; > }; > >diff --git a/t/db_dependent/Koha/Checkouts.t b/t/db_dependent/Koha/Checkouts.t >index 312029037ac..deb166fdbad 100755 >--- a/t/db_dependent/Koha/Checkouts.t >+++ b/t/db_dependent/Koha/Checkouts.t >@@ -165,6 +165,8 @@ subtest 'patron' => sub { > } > )->store; > >+ t::lib::Mocks::mock_userenv( { branchcode => $library->{branchcode} } ); >+ > my $p = $checkout->patron; > is( ref($p), 'Koha::Patron', > 'Koha::Checkout->patron should return a Koha::Patron' ); >-- >2.39.3 (Apple Git-146)
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 33641
:
170105
|
170106
|
170107
|
170108
|
170109
|
170110
|
170111
|
170138
|
170139
|
170140
|
170141
|
173562
|
173563
|
173564
|
173565
|
174510
|
174511
|
174512
|
174513
|
174514
|
174536
|
174538
|
174569
|
174570
|
174571
|
174572
|
174573
|
174574
|
174584
|
174585