Bugzilla – Attachment 43632 Details for
Bug 14778
DBIC should create/own the DB handler
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14778: Mocks Koha::Database->_new_schema instead of C4::Context->_new_dbh
Bug-14778-Mocks-KohaDatabase-newschema-instead-of-.patch (text/plain), 1.38 KB, created by
Jonathan Druart
on 2015-10-20 15:01:47 UTC
(
hide
)
Description:
Bug 14778: Mocks Koha::Database->_new_schema instead of C4::Context->_new_dbh
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-10-20 15:01:47 UTC
Size:
1.38 KB
patch
obsolete
>From 9d11e1a332855debf4b3710f3e36037b07594513 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 20 Oct 2015 12:03:54 +0100 >Subject: [PATCH] Bug 14778: Mocks Koha::Database->_new_schema instead of > C4::Context->_new_dbh > >C4::Context::_new_dbh does not exist anymore. >Koha::Database::_new_schema should be mocked instead. > >Will fix: >- t/00-load.t >- t/Breeding.t >- t/ImportBatch.t >- t/Message.t >- t/Overdues.t >- t/Prices.t >- t/RotatingCollections.t >- t/Search.t >- t/SuggestionEngine_AuthorityFile.t >- t/XSLT.t >--- > t/lib/Mocks.pm | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > >diff --git a/t/lib/Mocks.pm b/t/lib/Mocks.pm >index 55ce9d5..22ac659 100644 >--- a/t/lib/Mocks.pm >+++ b/t/lib/Mocks.pm >@@ -3,7 +3,7 @@ package t::lib::Mocks; > use Modern::Perl; > use C4::Context; > >-use DBD::Mock; >+use Koha::Schema; > use Test::MockModule; > > my %configs; >@@ -39,10 +39,9 @@ sub mock_preference { > } > > sub mock_dbh { >- my $context = new Test::MockModule('C4::Context'); >- $context->mock( '_new_dbh', sub { >- my $dbh = DBI->connect( 'DBI:Mock:', '', '' ) >- || die "Cannot create handle: $DBI::errstr\n"; >+ our $context = new Test::MockModule('Koha::Database'); >+ $context->mock( '_new_schema', sub { >+ my $dbh = Koha::Schema->connect( 'DBI:Mock:', '', '' ); > return $dbh; > } ); > return $context; >-- >2.1.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 14778
:
42326
|
42388
|
43247
|
43248
|
43249
|
43250
|
43440
|
43631
|
43632
|
43633
|
43634
|
43635
|
43636
|
43637
|
43638
|
43639
|
43640
|
43641
|
43642
|
43643
|
43644
|
43645
|
43834
|
43835
|
43836
|
43837
|
43838
|
43839
|
43840
|
43841
|
43842
|
43843
|
43844
|
43845
|
43846
|
43847
|
43848
|
43849
|
43850
|
43851
|
43852
|
43853
|
43857
|
43858
|
43859
|
43860
|
43861
|
43862
|
43863
|
43864
|
43865
|
43866
|
43867
|
43868
|
43869
|
43870
|
43871
|
43872
|
43873
|
43874
|
43875
|
43876
|
44003