Bugzilla – Attachment 174512 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: Unit Tests
Bug-33641-Unit-Tests.patch (text/plain), 2.09 KB, created by
Nick Clemens (kidclamp)
on 2024-11-14 12:44:32 UTC
(
hide
)
Description:
Bug 33641: Unit Tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-11-14 12:44:32 UTC
Size:
2.09 KB
patch
obsolete
>From e8eda9e64eda3d9e14deccd36fe6688bffe8d9ce Mon Sep 17 00:00:00 2001 >From: Eric Garcia <cubingguy714@gmail.com> >Date: Tue, 6 Aug 2024 19:06:45 +0000 >Subject: [PATCH] Bug 33641: Unit Tests > >Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../Circulation/MarkIssueReturned.t | 32 ++++++++++++++++++- > 1 file changed, 31 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation/MarkIssueReturned.t b/t/db_dependent/Circulation/MarkIssueReturned.t >index 9c43132a256..a744e1a5d5a 100755 >--- a/t/db_dependent/Circulation/MarkIssueReturned.t >+++ b/t/db_dependent/Circulation/MarkIssueReturned.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 4; >+use Test::More tests => 5; > use Test::Exception; > > use t::lib::Mocks; >@@ -304,3 +304,33 @@ subtest 'AutoRemoveOverduesRestrictions' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'Pass return_branch to old_issues' => sub { >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $category = $builder->build_object( { class => 'Koha::Patron::Categories', value => { category_type => 'P', enrolmentfee => 0 } } ); >+ my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $patron = $builder->build_object( >+ { class => 'Koha::Patrons', >+ value => { branchcode => $library->branchcode, categorycode => $category->categorycode } >+ } >+ ); >+ my $item = $builder->build_sample_item( >+ { >+ library => $library->branchcode, >+ } >+ ); >+ >+ t::lib::Mocks::mock_userenv( { branchcode => $library->branchcode } ); >+ >+ my $issue = C4::Circulation::AddIssue( $patron, $item->barcode ); >+ my $issue_id = C4::Circulation::MarkIssueReturned( $patron->borrowernumber, $item->itemnumber ); >+ >+ is( $issue_id, $issue->issue_id, 'Item has been returned' ); >+ my $old_issue = Koha::Old::Checkouts->find( $issue_id ); >+ is( $old_issue->return_branch, $library->branchcode, 'Return branch is passed correctly' ); >+ >+ $schema->storage->txn_rollback >+}; >-- >2.39.5
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