Bugzilla – Attachment 101007 Details for
Bug 24901
C4::Circulation::transferbook lacks tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24901: Minor refactor of tests
Bug-24901-Minor-refactor-of-tests.patch (text/plain), 1.95 KB, created by
Nick Clemens (kidclamp)
on 2020-03-19 12:20:31 UTC
(
hide
)
Description:
Bug 24901: Minor refactor of tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-03-19 12:20:31 UTC
Size:
1.95 KB
patch
obsolete
>From 6deeca03e7959ef8dc304abc8ad1442c8a0a2d43 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 18 Mar 2020 19:25:57 +0000 >Subject: [PATCH] Bug 24901: Minor refactor of tests > >Test plan: >0/ Read the change and verify it makes sense > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Circulation/transferbook.t | 27 ++++++++++++++++++--------- > 1 file changed, 18 insertions(+), 9 deletions(-) > >diff --git a/t/db_dependent/Circulation/transferbook.t b/t/db_dependent/Circulation/transferbook.t >index 835490351c..e37324f147 100644 >--- a/t/db_dependent/Circulation/transferbook.t >+++ b/t/db_dependent/Circulation/transferbook.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 3; >+use Test::More tests => 2; > use t::lib::TestBuilder; > use t::lib::Mocks; > >@@ -27,16 +27,25 @@ use Koha::DateUtils qw( dt_from_string ); > > my $builder = t::lib::TestBuilder->new; > >-my $library = $builder->build( { source => 'Branch' } ); >+subtest 'transfer a non-existant item' => sub { >+ plan tests => 2; > >-#Transfert on unknown barcode >-my $item = $builder->build_sample_item(); >-my $badbc = $item->barcode; >-$item->delete; >+ my $library = $builder->build( { source => 'Branch' } ); > >-my ( $dotransfer, $messages ) = C4::Circulation::transferbook( $library->{branchcode}, $badbc ); >-is( $dotransfer, 0, "Can't transfer a bad barcode"); >-is_deeply( $messages, { BadBarcode => $badbc }, "We got the expected barcode"); >+ #Transfert on unknown barcode >+ my $item = $builder->build_sample_item(); >+ my $badbc = $item->barcode; >+ $item->delete; >+ >+ my ( $dotransfer, $messages ) = >+ C4::Circulation::transferbook( $library->{branchcode}, $badbc ); >+ is( $dotransfer, 0, "Can't transfer a bad barcode" ); >+ is_deeply( >+ $messages, >+ { BadBarcode => $badbc }, >+ "We got the expected barcode" >+ ); >+}; > > subtest 'transfer an issued item' => sub { > plan tests => 3; >-- >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 24901
:
100996
|
100997
| 101007 |
101008
|
102519