Bugzilla – Attachment 86527 Details for
Bug 22493
DecreaseLoanHighHolds.t creates some items/patrons with set values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22493: Clean up DecreaseLoanHighHolds.t
Bug-22493-Clean-up-DecreaseLoanHighHoldst.patch (text/plain), 3.52 KB, created by
Martin Renvoize
on 2019-03-12 13:07:24 UTC
(
hide
)
Description:
Bug 22493: Clean up DecreaseLoanHighHolds.t
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2019-03-12 13:07:24 UTC
Size:
3.52 KB
patch
obsolete
>From 947aff9eaa06f6fa1591531082d61798c55f32af Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 11 Mar 2019 14:47:01 +0000 >Subject: [PATCH] Bug 22493: Clean up DecreaseLoanHighHolds.t > >To test: > >1 - prove -v t/db_dependent/DecreaseLoanHighHolds.t >2 - should pass >3 - read code, confirm changes make sense > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/DecreaseLoanHighHolds.t | 41 ++++++++++++++------------ > 1 file changed, 22 insertions(+), 19 deletions(-) > >diff --git a/t/db_dependent/DecreaseLoanHighHolds.t b/t/db_dependent/DecreaseLoanHighHolds.t >index 0ef46f3cbe..daa975bb9b 100755 >--- a/t/db_dependent/DecreaseLoanHighHolds.t >+++ b/t/db_dependent/DecreaseLoanHighHolds.t >@@ -38,11 +38,6 @@ my $builder = t::lib::TestBuilder->new; > $dbh->{RaiseError} = 1; > $schema->storage->txn_begin(); > >-$dbh->do('DELETE FROM issues'); >-$dbh->do('DELETE FROM issuingrules'); >-$dbh->do('DELETE FROM borrowers'); >-$dbh->do('DELETE FROM items'); >- > my $now_value = DateTime->now(); > my $mocked_datetime = Test::MockModule->new('DateTime'); > $mocked_datetime->mock( 'now', sub { return $now_value->clone; } ); >@@ -54,29 +49,36 @@ my $itemtype = $builder->build( { source => 'Itemtype' } )->{itemtype}; > t::lib::Mocks::mock_userenv({ branchcode => $library->{branchcode} }); > is( C4::Context->userenv->{branch}, $library->{branchcode}, 'userenv set' ); > >-my $patron_category = $builder->build({ source => 'Category', value => { category_type => 'P', enrolmentfee => 0 } }); >+my $patron_category = $builder->build({ >+ source => 'Category', >+ value => { >+ category_type => 'P', >+ enrolmentfee => 0 >+ } >+}); >+ > my @patrons; > for my $i ( 1 .. 20 ) { >- my $patron = Koha::Patron->new( >- { cardnumber => $i, firstname => 'Kyle', surname => 'Hall', categorycode => $category->{categorycode}, branchcode => $library->{branchcode}, categorycode => $patron_category->{categorycode}, } ) >- ->store(); >+ my $patron = Koha::Patron->new({ >+ firstname => 'Kyle', >+ surname => 'Hall', >+ categorycode => $category->{categorycode}, >+ branchcode => $library->{branchcode}, >+ categorycode => $patron_category->{categorycode}, >+ })->store(); > push( @patrons, $patron ); > } > >-my $biblio = Koha::Biblio->new()->store(); >-my $biblioitem = >- $schema->resultset('Biblioitem')->new( { biblionumber => $biblio->biblionumber } )->insert(); >+my $biblio = $builder->build_sample_biblio(); > > my @items; > for my $i ( 1 .. 10 ) { >- my $item = Koha::Item->new( >+ my $item = $builder->build_sample_item( > { > biblionumber => $biblio->id(), >- biblioitemnumber => $biblioitem->id(), >- barcode => $i, > itype => $itemtype > } >- )->store(); >+ ); > push( @items, $item ); > } > >@@ -91,13 +93,16 @@ for my $i ( 0 .. 5 ) { > )->store(); > } > >+my $item = pop(@items); >+my $patron = pop(@patrons); >+ > $builder->build( > { > source => 'Issuingrule', > value => { > branchcode => '*', > categorycode => '*', >- itemtype => '*', >+ itemtype => $item->itype, > issuelength => '14', > lengthunit => 'days', > reservesallowed => '99', >@@ -105,8 +110,6 @@ $builder->build( > } > ); > >-my $item = pop(@items); >-my $patron = pop(@patrons); > > my $orig_due = C4::Circulation::CalcDateDue( > DateTime->now(time_zone => C4::Context->tz()), >-- >2.20.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 22493
:
86461
|
86476
| 86527