Bugzilla – Attachment 99502 Details for
Bug 24545
Replace Franklin Street by gnu.org/licenses in copyright
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24705: Add tests
Bug-24705-Add-tests.patch (text/plain), 3.08 KB, created by
Marcel de Rooy
on 2020-02-24 12:28:12 UTC
(
hide
)
Description:
Bug 24705: Add tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-02-24 12:28:12 UTC
Size:
3.08 KB
patch
obsolete
>From 3cfda6ba798eeeb6693bcad90ef6f1ac1a47521d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 24 Feb 2020 10:40:54 +0100 >Subject: [PATCH] Bug 24705: Add tests >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/SIP/Transaction.t | 62 +++++++++++++++++++++++++++++++++++++++- > 1 file changed, 61 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t >index bc7af8bb4d..c6d2abd65f 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 => 6; >+use Test::More tests => 7; > > use Koha::Database; > use t::lib::TestBuilder; >@@ -209,4 +209,64 @@ subtest cancel_hold => sub { > is( $item->holds->count(), 0, "Item has 0 holds remaining"); > }; > >+subtest do_hold => sub { >+ plan tests => 7; >+ >+ my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $patron_1 = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { >+ branchcode => $library->branchcode, >+ } >+ } >+ ); >+ my $patron_2 = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { >+ branchcode => $library->branchcode, >+ categorycode => $patron_1->categorycode, >+ } >+ } >+ ); >+ >+ t::lib::Mocks::mock_userenv( >+ { branchcode => $library->branchcode, flags => 1 } ); >+ >+ my $item = $builder->build_sample_item( >+ { >+ library => $library->branchcode, >+ } >+ ); >+ >+ my $reserve1 = AddReserve( >+ { >+ branchcode => $library->branchcode, >+ borrowernumber => $patron_1->borrowernumber, >+ biblionumber => $item->biblio->biblionumber, >+ itemnumber => $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( $patron_2->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->do_hold(); >+ is( $item->biblio->holds->count(), 2, "Bib has 2 holds" ); >+ >+ is( $patron_2->holds->next->priority, 2, 'Hold placed from SIP should have a correct priority of 2'); >+}; >+ > $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 24545
:
98232
|
98233
|
98270
|
98271
|
98278
|
99068
|
99069
|
99070
|
99502
|
99503
|
99504
|
99505
|
99506
|
99507
|
99513
|
99530
|
100386