Bugzilla – Attachment 121073 Details for
Bug 24434
C4::Circulation::updateWrongTransfer is never called but should be
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24434: Add Unit Tests for relations
Bug-24434-Add-Unit-Tests-for-relations.patch (text/plain), 2.51 KB, created by
Victor Grousset/tuxayo
on 2021-05-17 21:33:40 UTC
(
hide
)
Description:
Bug 24434: Add Unit Tests for relations
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2021-05-17 21:33:40 UTC
Size:
2.51 KB
patch
obsolete
>From 8f82db2d535f69762c8d216e337d86815bc9cc65 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 10 May 2021 09:12:38 +0100 >Subject: [PATCH] Bug 24434: Add Unit Tests for relations > >This patch adds unit tests for the newly introduced to_library (and also >add the missing test for the existing from_library). > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > t/db_dependent/Koha/Item/Transfer.t | 46 ++++++++++++++++++++++++++++- > 1 file changed, 45 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Item/Transfer.t b/t/db_dependent/Koha/Item/Transfer.t >index 22b82be628..54b8208419 100755 >--- a/t/db_dependent/Koha/Item/Transfer.t >+++ b/t/db_dependent/Koha/Item/Transfer.t >@@ -24,7 +24,7 @@ use Koha::DateUtils; > > use t::lib::TestBuilder; > >-use Test::More tests => 5; >+use Test::More tests => 7; > use Test::Exception; > > my $schema = Koha::Database->new->schema; >@@ -52,6 +52,50 @@ subtest 'item relation tests' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'from_library relation tests' => sub { >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $transfer = $builder->build_object( >+ { >+ class => 'Koha::Item::Transfers', >+ value => { >+ frombranch => $library->branchcode, >+ } >+ } >+ ); >+ >+ my $from_library = $transfer->from_library; >+ is( ref( $from_library ), 'Koha::Library', 'Koha::Item::Transfer->from_library should return a Koha::Library' ); >+ is( $from_library->branchcode, $library->branchcode, 'Koha::Item::Transfer->from_library should return the correct library' ); >+ >+ $schema->storage->txn_rollback; >+}; >+ >+subtest 'to_library relation tests' => sub { >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $transfer = $builder->build_object( >+ { >+ class => 'Koha::Item::Transfers', >+ value => { >+ tobranch => $library->branchcode, >+ } >+ } >+ ); >+ >+ my $to_library = $transfer->to_library; >+ is( ref( $to_library ), 'Koha::Library', 'Koha::Item::Transfer->to_library should return a Koha::Library' ); >+ is( $to_library->branchcode, $library->branchcode, 'Koha::Item::Transfer->to_library should return the correct library' ); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'transit tests' => sub { > plan tests => 7; > >-- >2.31.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 24434
:
97449
|
97550
|
99829
|
120625
|
120631
|
120632
|
120657
|
120658
|
120683
|
120684
|
120757
|
120758
|
121029
|
121030
|
121031
|
121032
|
121033
|
121034
|
121057
|
121058
|
121059
|
121060
|
121061
|
121071
|
121072
|
121073
|
121074
|
121075
|
121515
|
121702
|
121703
|
121704
|
121705
|
121706
|
121707
|
121798
|
121799
|
121800
|
121801
|
121802
|
121803
|
121804