Bugzilla – Attachment 122924 Details for
Bug 25619
Updating an expiration date for a waiting hold won't save
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25619: Unit Tests
Bug-25619-Unit-Tests.patch (text/plain), 2.44 KB, created by
Kyle M Hall (khall)
on 2021-07-16 18:27:10 UTC
(
hide
)
Description:
Bug 25619: Unit Tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2021-07-16 18:27:10 UTC
Size:
2.44 KB
patch
obsolete
>From 401a7781d27ebc6e239b98b4f03d739859de30ef Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 16 Jul 2021 14:26:37 -0400 >Subject: [PATCH] Bug 25619: Unit Tests > >--- > t/db_dependent/Holds.t | 57 +++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 56 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index 64419b5fee..b39d8eec16 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -7,7 +7,7 @@ use t::lib::TestBuilder; > > use C4::Context; > >-use Test::More tests => 71; >+use Test::More tests => 72; > use MARC::Record; > > use C4::Biblio; >@@ -1610,3 +1610,58 @@ subtest 'CanItemBeReserved rule precedence tests' => sub { > $schema->storage->txn_rollback; > > }; >+ >+subtest 'CanItemBeReserved rule precedence tests' => sub { >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $category = $builder->build({ source => 'Category' }); >+ my $branch = $builder->build({ source => 'Branch' })->{ branchcode }; >+ my $biblio = $builder->build_sample_biblio( { itemtype => 'DUMMY' } ); >+ my $itemnumber = $builder->build_sample_item( >+ { library => $branch, biblionumber => $biblio->biblionumber } ) >+ ->itemnumber; >+ >+ my $borrowernumber = Koha::Patron->new( >+ { >+ firstname => 'my firstname', >+ surname => 'my surname ' . $_, >+ categorycode => $category->{categorycode}, >+ branchcode => $branch, >+ } >+ )->store->borrowernumber; >+ >+ my $reserve_id = AddReserve( >+ { >+ branchcode => $branch, >+ borrowernumber => $borrowernumber, >+ biblionumber => $biblio->biblionumber, >+ priority => >+ C4::Reserves::CalculatePriority( $biblio->biblionumber ), >+ itemnumber => $itemnumber, >+ } >+ ); >+ >+ my $hold = Koha::Holds->find($reserve_id); >+ >+ $hold->set( { priority => 0, found => 'W' } )->store(); >+ >+ ModReserve( >+ { >+ reserve_id => $hold->id, >+ expirationdate => '1981-06-10', >+ priority => 99, >+ rank => 0, >+ } >+ ); >+ >+ $hold = Koha::Holds->find($reserve_id); >+ >+ is( $hold->expirationdate, '1981-06-10', >+ 'Found hold expiration date updated correctly' ); >+ is( $hold->priority, '0', 'Found hold priority was not updated' ); >+ >+ $schema->storage->txn_rollback; >+ >+}; >-- >2.30.1 (Apple Git-130)
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 25619
:
122922
|
122923
|
122924
|
122929
|
122930
|
123043
|
123693
|
123694
|
123695
|
123779
|
124120
|
124121
|
124122
|
124123
|
124124