Bugzilla – Attachment 23802 Details for
Bug 11439
UT: XISBN.t returns failure
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11439: UT: Improve XISBN.t
Bug-11439-UT-Improve-XISBNt.patch (text/plain), 1.62 KB, created by
Jonathan Druart
on 2013-12-24 09:14:15 UTC
(
hide
)
Description:
Bug 11439: UT: Improve XISBN.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-12-24 09:14:15 UTC
Size:
1.62 KB
patch
obsolete
>From 0773e39ad1d1b292118ca91d101268f7419504e8 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 24 Dec 2013 10:11:32 +0100 >Subject: [PATCH] Bug 11439: UT: Improve XISBN.t > >The tests should be executed into a transaction and the SimpleSearch >routine correctly mocked. > >Test plan: >Verify that prove t/db_dependent/XISBN.t returns green. >--- > t/db_dependent/XISBN.t | 18 ++++++++---------- > 1 file changed, 8 insertions(+), 10 deletions(-) > >diff --git a/t/db_dependent/XISBN.t b/t/db_dependent/XISBN.t >index 01bcc0f..55f25a1 100755 >--- a/t/db_dependent/XISBN.t >+++ b/t/db_dependent/XISBN.t >@@ -5,21 +5,24 @@ > > use Modern::Perl; > >-# use Test::Class::Load qw ( t/db_dependent/ ); > use Test::More tests => 5; > use MARC::Record; > use C4::Biblio; > use C4::XISBN; >-use Data::Dumper; > use C4::Context; >+use Test::MockModule; > > BEGIN { > use_ok('C4::XISBN'); > } > >-# Avoid "redefined subroutine" warnings >-local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /redefined/ }; >-*C4::Search::SimpleSearch = \&Mock_SimpleSearch; >+my $dbh = C4::Context->dbh; >+$dbh->{RaiseError} = 1; >+$dbh->{AutoCommit} = 0; >+ >+my $search_module = new Test::MockModule('C4::Search'); >+ >+$search_module->mock('SimpleSearch', \&Mock_SimpleSearch ); > > my $context = C4::Context->new; > >@@ -62,11 +65,6 @@ is( $results_xisbn->[0]->{biblionumber}, > $biblionumber3, > "Gets correct biblionumber from a book with a similar isbn using XISBN." ); > >-# clean up after ourselves >-DelBiblio($biblionumber1); >-DelBiblio($biblionumber2); >-DelBiblio($biblionumber3); >- > # Util subs > > # Add new biblio with isbn and return biblionumber >-- >1.7.10.4
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 11439
:
23801
|
23802
|
23822
|
23823
|
24104
|
24112
|
24129