Bugzilla – Attachment 100996 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), 2.13 KB, created by
Martin Renvoize (ashimema)
on 2020-03-19 08:13:57 UTC
(
hide
)
Description:
Bug 24901: Minor refactor of tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-03-19 08:13:57 UTC
Size:
2.13 KB
patch
obsolete
>From 7ad682f4de661eca8ae0c3bfa46e4098e6abf6d9 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 >--- > t/db_dependent/Circulation/transferbook.t | 29 ++++++++++++++++------- > 1 file changed, 20 insertions(+), 9 deletions(-) > >diff --git a/t/db_dependent/Circulation/transferbook.t b/t/db_dependent/Circulation/transferbook.t >index 835490351c..2e82363b5b 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; >@@ -76,3 +85,5 @@ subtest 'transfer an issued item' => sub { > is( $messages->{ResFound}->{ResFound}, 'Reserved', "We found the reserve"); > is( $messages->{ResFound}->{itemnumber}, $item->itemnumber, "We got the reserve info"); > }; >+ >+ >-- >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 24901
:
100996
|
100997
|
101007
|
101008
|
102519