Bugzilla – Attachment 126927 Details for
Bug 24609
Add routes for updating checkouts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24609: Unit tests for Koha::Checkout->store
Bug-24609-Unit-tests-for-KohaCheckout-store.patch (text/plain), 1.67 KB, created by
Martin Renvoize
on 2021-10-26 15:22:00 UTC
(
hide
)
Description:
Bug 24609: Unit tests for Koha::Checkout->store
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2021-10-26 15:22:00 UTC
Size:
1.67 KB
patch
obsolete
>From 6627096fb673cb74767686090c1191dc4a1b3ae8 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 26 Oct 2021 15:20:39 +0100 >Subject: [PATCH] Bug 24609: Unit tests for Koha::Checkout->store > >This patch adds unit tests for the Koha::Item onloan trigger inside >Koha::Checkout->store(); > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/Checkout.t | 28 +++++++++++++++++++++++++++- > 1 file changed, 27 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Checkout.t b/t/db_dependent/Koha/Checkout.t >index f8288ea02a..ec8e198861 100755 >--- a/t/db_dependent/Koha/Checkout.t >+++ b/t/db_dependent/Koha/Checkout.t >@@ -19,14 +19,40 @@ > > use Modern::Perl; > >-use Test::More tests => 1; >+use Test::More tests => 2; > use t::lib::TestBuilder; > > use Koha::Database; >+use Koha::DateUtils qw( dt_from_string ); > > my $builder = t::lib::TestBuilder->new; > my $schema = Koha::Database->new->schema; > >+subtest 'store() tests' => sub { >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $checkout = $builder->build_object( >+ { >+ class => 'Koha::Checkouts' >+ } >+ ); >+ >+ my $new_due = dt_from_string()->add( days => 7 ); >+ >+ # Update date due for checkout >+ $checkout->date_due($new_due)->store(); >+ $checkout->discard_changes; >+ >+ is( dt_from_string($checkout->date_due), $new_due, "Checkout date_due updated" ); >+ >+ my $item = $checkout->item; >+ is( dt_from_string($item->onloan), $new_due->truncate( to => 'day' ), "Item->onloan update with date_due"); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'library() tests' => sub { > > plan tests => 2; >-- >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 24609
:
98924
|
98925
|
99021
|
99022
|
115879
|
115880
|
115881
|
126191
|
126192
|
126193
|
126194
|
126316
|
126317
|
126318
|
126319
|
126320
|
126321
|
126917
|
126921
|
126922
|
126923
|
126924
|
126925
|
126926
| 126927 |
126928