Bugzilla – Attachment 96680 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: [19.05.x] Unit tests
Bug-24175-1905x-Unit-tests.patch (text/plain), 3.69 KB, created by
Nick Clemens (kidclamp)
on 2019-12-30 12:12:52 UTC
(
hide
)
Description:
Bug 24175: [19.05.x] Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-12-30 12:12:52 UTC
Size:
3.69 KB
patch
obsolete
>From e3f6fa45da2a5e8ce337be14bc6058780d41761e Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 4 Dec 2019 18:38:22 +0000 >Subject: [PATCH] Bug 24175: [19.05.x] Unit tests >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Bug 24175: Simplify tests > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Bug 24175: [19.05.x] Remove use of Koha::Item::Holds >--- > t/db_dependent/SIP/Transaction.t | 51 +++++++++++++++++++++++++++++++++++++++- > 1 file changed, 50 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t >index 076fb29c35..6a79a00767 100755 >--- a/t/db_dependent/SIP/Transaction.t >+++ b/t/db_dependent/SIP/Transaction.t >@@ -4,7 +4,7 @@ > # Current state is very rudimentary. Please help to extend it! > > use Modern::Perl; >-use Test::More tests => 4; >+use Test::More tests => 5; > > use Koha::Database; > use t::lib::TestBuilder; >@@ -12,6 +12,7 @@ use t::lib::Mocks; > use C4::SIP::ILS::Patron; > use C4::SIP::ILS::Transaction::RenewAll; > use C4::SIP::ILS::Transaction::Checkout; >+use C4::SIP::ILS::Transaction::Hold; > > use C4::Reserves; > use Koha::IssuingRules; >@@ -95,4 +96,52 @@ subtest fill_holds_at_checkout => sub { > $transaction = C4::SIP::ILS::Transaction::Checkout->new(); > is( $sip_item->{barcode}, $item1->{barcode}, "Item assigned to transaction" ); > }; >+ >+subtest cancel_hold => sub { >+ plan tests => 7; >+ >+ 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 => $library->branchcode, flags => 1 }); >+ >+ my $item = $builder->build_sample_item({ >+ library => $library->branchcode, >+ }); >+ >+ Koha::IssuingRule->new({ >+ categorycode => $patron->categorycode, >+ itemtype => $item->effective_itemtype, >+ branchcode => $library->branchcode, >+ onshelfholds => 1, >+ reservesallowed => 3, >+ holds_per_record => 3, >+ issuelength => 5, >+ lengthunit => 'days', >+ })->store; >+ >+ 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( Koha::Holds->search({itemnumber=>$item->itemnumber})->count() ,1,"Hold was placed on specific item"); >+ >+ 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( $item->biblio->holds->count(), 0, "Bib has 0 holds remaining"); >+ is( Koha::Holds->search({itemnumber=>$item->itemnumber})->count(), 0, "Item has 0 holds remaining"); >+}; >+ > $schema->storage->txn_rollback; >-- >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