Bugzilla – Attachment 43250 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: [DO NOT WORK] Try to make DBI:Mock pass but fail
Bug-14778-DO-NOT-WORK-Try-to-make-DBIMock-pass-but.patch (text/plain), 1.44 KB, created by
Jonathan Druart
on 2015-10-08 10:42:36 UTC
(
hide
)
Description:
Bug 14778: [DO NOT WORK] Try to make DBI:Mock pass but fail
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-10-08 10:42:36 UTC
Size:
1.44 KB
patch
obsolete
>From 160230931245853e6b16383baea22df9266cea48 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 8 Oct 2015 11:40:43 +0100 >Subject: [PATCH] Bug 14778: [DO NOT WORK] Try to make DBI:Mock pass but fail > >I need some help here, I don't understand what's happen. >Some other tests are failing because they mock the db handler. Let's try >with this easy one. >--- > t/db_dependent/Sitemapper.t | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Sitemapper.t b/t/db_dependent/Sitemapper.t >index 293edad..3eb5b92 100755 >--- a/t/db_dependent/Sitemapper.t >+++ b/t/db_dependent/Sitemapper.t >@@ -23,6 +23,7 @@ use File::Basename; > use File::Path; > use DateTime; > use Test::More tests => 14; >+use Koha::Schema; > > > BEGIN { >@@ -43,12 +44,13 @@ sub slurp { > > # Create 3 mocked dataset to be used by Koha::Sitemaper in place of DB content > my $module_context = new Test::MockModule('C4::Context'); >-$module_context->mock('_new_dbh', sub { >- my $dbh = DBI->connect( 'DBI:Mock:', '', '' ) >- || die "Cannot create handle: $DBI::errstr\n"; >+$module_context->mock('dbh', sub { >+ my $schema = Koha::Schema->connect( 'dbi:Mock:', '', '' ); >+ my $dbh = $schema->storage->dbh >+ || die "Cannot create handle\n"; > return $dbh > }); >-my $dbh = C4::Context->dbh(); >+my $dbh = C4::Context->dbh; > my $two_bibs = [ > [ qw/ biblionumber timestamp / ], > [ qw/ 1234 2013-11-15 / ], >-- >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