Bugzilla – Attachment 100625 Details for
Bug 24298
Record if a transfer was triggered by 'return to homebranch'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24298: Update test count and use build_sample_item
Bug-24298-Update-test-count-and-use-buildsampleite.patch (text/plain), 3.20 KB, created by
Nick Clemens
on 2020-03-12 12:16:02 UTC
(
hide
)
Description:
Bug 24298: Update test count and use build_sample_item
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2020-03-12 12:16:02 UTC
Size:
3.20 KB
patch
obsolete
>From 16419bbed8ef14bc087c57e076270dc39474d80c Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 12 Mar 2020 07:52:00 -0400 >Subject: [PATCH] Bug 24298: Update test count and use build_sample_item > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Items.t | 48 ++++++++++++++---------------------------------- > 1 file changed, 14 insertions(+), 34 deletions(-) > >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index f72315dd83..da4b6f0400 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -33,7 +33,7 @@ use Koha::AuthorisedValues; > use t::lib::Mocks; > use t::lib::TestBuilder; > >-use Test::More tests => 15; >+use Test::More tests => 16; > > use Test::Warn; > >@@ -117,29 +117,21 @@ subtest 'ModItem tests' => sub { > $schema->storage->txn_begin; > > my $builder = t::lib::TestBuilder->new; >- my $item = $builder->build({ >- source => 'Item', >- value => { >- itemlost => 0, >- damaged => 0, >- withdrawn => 0, >- itemlost_on => undef, >- damaged_on => undef, >- withdrawn_on => undef, >- } >- }); >+ my $item = $builder->build_sample_item(); > > my @fields = qw( itemlost withdrawn damaged ); > for my $field (@fields) { >- $item->{$field} = 1; >- ModItem( $item, $item->{biblionumber}, $item->{itemnumber} ); >- my $post_mod_item = Koha::Items->find({ itemnumber => $item->{itemnumber} })->unblessed; >- is( output_pref({ str => $post_mod_item->{$field."_on"}, dateonly => 1 }), output_pref({ dt => dt_from_string(), dateonly => 1 }), "When updating $field, $field"."_on is updated" ); >- >- $item->{$field} = 0; >- ModItem( $item, $item->{biblionumber}, $item->{itemnumber} ); >- $post_mod_item = Koha::Items->find({ itemnumber => $item->{itemnumber} })->unblessed; >- is( $post_mod_item->{$field."_on"}, undef, "When clearing $field, $field"."_on is cleared" ); >+ my $field_on = $field."_on"; >+ >+ $item->$field(1); >+ ModItem( $item->unblessed, $item->biblionumber, $item->itemnumber ); >+ $item->discard_changes; >+ is( output_pref({ str => $item->$field_on, dateonly => 1 }), output_pref({ dt => dt_from_string(), dateonly => 1 }), "When updating $field, $field_on is updated" ); >+ >+ $item->$field(0); >+ ModItem( $item->unblessed, $item->biblionumber, $item->itemnumber ); >+ $item->discard_changes; >+ is( $item->$field_on, undef, "When clearing $field, $field_on is cleared" ); > } > > $schema->storage->txn_rollback; >@@ -152,19 +144,7 @@ subtest 'ModItemTransfer tests' => sub { > $schema->storage->txn_begin; > > my $builder = t::lib::TestBuilder->new; >- my $item = $builder->build_object( >- { >- class => 'Koha::Items', >- value => { >- itemlost => 0, >- damaged => 0, >- withdrawn => 0, >- itemlost_on => undef, >- damaged_on => undef, >- withdrawn_on => undef, >- } >- } >- )->store; >+ my $item = $builder->build_sample_item(); > > my $library1 = $builder->build( > { >-- >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 24298
:
97450
|
97451
|
97506
|
97507
|
97535
|
97536
|
98292
|
98293
|
98294
|
99774
|
99775
|
99776
|
99777
|
99781
|
99782
|
99783
|
99784
|
100621
|
100622
|
100623
|
100624
| 100625 |
103792