Bugzilla – Attachment 128635 Details for
Bug 29719
onloan dates are cleared from items when importing and overlaying
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29719: Unit tests
Bug-29719-Unit-tests.patch (text/plain), 1.59 KB, created by
Nick Clemens (kidclamp)
on 2021-12-16 16:23:52 UTC
(
hide
)
Description:
Bug 29719: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-12-16 16:23:52 UTC
Size:
1.59 KB
patch
obsolete
>From dce1eca680d2d5b0489c66c464234042d84f847b Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 16 Dec 2021 16:20:59 +0000 >Subject: [PATCH] Bug 29719: Unit tests > >--- > t/db_dependent/Koha/Object.t | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t >index 0da041f596..0de1167f91 100755 >--- a/t/db_dependent/Koha/Object.t >+++ b/t/db_dependent/Koha/Object.t >@@ -934,11 +934,11 @@ subtest 'prefetch_whitelist() tests' => sub { > > subtest 'set_or_blank' => sub { > >- plan tests => 5; >+ plan tests => 7; > > $schema->storage->txn_begin; > >- my $item = $builder->build_sample_item; >+ my $item = $builder->build_sample_item({ onloan => '2021-01-01'}); > my $item_info = $item->unblessed; > $item = $item->set_or_blank($item_info); > is_deeply($item->unblessed, $item_info, 'set_or_blank assign the correct value if unchanged'); >@@ -963,6 +963,16 @@ subtest 'set_or_blank' => sub { > $item = $item->set_or_blank($item_info); > isnt($item->timestamp, undef, 'set_or_blank should have set timestamp to a correct value'); > >+ # timestamp not null >+ delete $item_info->{onloan}; >+ $item = $item->set_or_blank($item_info); >+ is($item->onloan, '2021-01-01', 'set_or_blank should retain original onloan if none passed'); >+ >+ # timestamp not null >+ $item_info->{onloan} = '2020-01-01'; >+ $item = $item->set_or_blank($item_info); >+ is($item->onloan, '2020-01-01', 'set_or_blank should set onloan if passed'); >+ > $schema->storage->txn_rollback; > }; > >-- >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 29719
:
128635
|
128636
|
129515
|
129516
|
134662
|
134663
|
134996
|
134997