Bugzilla – Attachment 96378 Details for
Bug 24175
Cannot cancel holds - wrong parameter passed for itemnumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24175: Simplify tests
Bug-24175-Simplify-tests.patch (text/plain), 3.82 KB, created by
Jonathan Druart
on 2019-12-17 13:58:49 UTC
(
hide
)
Description:
Bug 24175: Simplify tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-12-17 13:58:49 UTC
Size:
3.82 KB
patch
obsolete
>From 96b5bc3d70972468fe50bf229747feca16373679 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 17 Dec 2019 14:57:58 +0100 >Subject: [PATCH] Bug 24175: Simplify tests > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/SIP/Transaction.t | 41 ++++++++++++++++++++-------------------- > 1 file changed, 20 insertions(+), 21 deletions(-) > >diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t >index 321e5c7cde..c7b30543ee 100755 >--- a/t/db_dependent/SIP/Transaction.t >+++ b/t/db_dependent/SIP/Transaction.t >@@ -140,29 +140,25 @@ subtest "FeePayment->pay tests" => sub { > subtest cancel_hold => sub { > plan tests => 7; > >- my $category = $builder->build({ source => 'Category', value => { category_type => 'A' }}); >- my $branch = $builder->build({ source => 'Branch' }); >- my $borrower = $builder->build({ source => 'Borrower', value =>{ >- branchcode => $branch->{branchcode}, >- categorycode=>$category->{categorycode} >+ my $library = $builder->build_object ({ class => 'Koha::Libraries' }); >+ my $patron = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { >+ branchcode => $library->branchcode, >+ } > } >- }); >- t::lib::Mocks::mock_userenv({ branchcode => $branch->{branchcode}, flags => 1 }); >+ ); >+ t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode, flags => 1 }); > >- my $itype = $builder->build({ source => 'Itemtype', value =>{notforloan=>0} }); >- my $biblio = $builder->build_sample_biblio(); > my $item = $builder->build_sample_item({ >- homebranch => $branch->{branchcode}, >- holdingbranch => $branch->{branchcode}, >- biblionumber => $biblio->biblionumber, >- itype => $itype->{itemtype}, >- notforloan => 0, >+ library => $library->branchcode, > }); > > Koha::IssuingRule->new({ >- categorycode => $borrower->{categorycode}, >- itemtype => $itype->{itemtype}, >- branchcode => $branch->{branchcode}, >+ categorycode => $patron->categorycode, >+ itemtype => $item->effective_itemtype, >+ branchcode => $library->branchcode, > onshelfholds => 1, > reservesallowed => 3, > holds_per_record => 3, >@@ -170,18 +166,21 @@ subtest cancel_hold => sub { > lengthunit => 'days', > })->store; > >- my $reserve1 = AddReserve($branch->{branchcode},$borrower->{borrowernumber},$biblio->biblionumber,undef,undef,undef,undef,undef,undef,$item->itemnumber); >- is( $biblio->holds->count(), 1, "Hold was placed on bib"); >+ my $reserve1 = >+ AddReserve( $library->branchcode, $patron->borrowernumber, >+ $item->biblio->biblionumber, >+ undef, undef, undef, undef, undef, undef, $item->itemnumber ); >+ is( $item->biblio->holds->count(), 1, "Hold was placed on bib"); > is( $item->holds->count(),1,"Hold was placed on specific item"); > >- my $sip_patron = C4::SIP::ILS::Patron->new( $borrower->{cardnumber} ); >+ my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber ); > my $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); > my $transaction = C4::SIP::ILS::Transaction::Hold->new(); > is( ref $transaction, "C4::SIP::ILS::Transaction::Hold", "New transaction created" ); > is( $transaction->patron( $sip_patron ), $sip_patron, "Patron assigned to transaction" ); > is( $transaction->item( $sip_item ), $sip_item, "Item assigned to transaction" ); > my $hold = $transaction->drop_hold(); >- is( $biblio->holds->count(), 0, "Bib has 0 holds remaining"); >+ is( $item->biblio->holds->count(), 0, "Bib has 0 holds remaining"); > is( $item->holds->count(), 0, "Item has 0 holds remaining"); > }; > >-- >2.11.0
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 24175
:
95999
|
96000
|
96372
|
96375
|
96376
|
96377
|
96378
|
96527
|
96528
|
96529
|
96530
|
96534
|
96535
|
96536
|
96537
|
96680
|
96681