Bugzilla – Attachment 49678 Details for
Bug 15323
./t/Prices.t fails without a valid database
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15323: Use fixtures for the active currency
Bug-15323-Use-fixtures-for-the-active-currency.patch (text/plain), 1.88 KB, created by
Jonathan Druart
on 2016-03-30 10:32:49 UTC
(
hide
)
Description:
Bug 15323: Use fixtures for the active currency
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-03-30 10:32:49 UTC
Size:
1.88 KB
patch
obsolete
>From 24bfdd9609f846d98f834d0770272c69b1654e3d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 30 Mar 2016 11:30:01 +0100 >Subject: [PATCH] Bug 15323: Use fixtures for the active currency > > prove t/Prices.t >fails after bug 15084 has been pushed >It's caused by > commit 1538e9ecf47642c4974693ff499c3e95e4d71977 > Bug 15084: Replace C4::Budgets::GetCurrencies with > Koha::Acquisition::Currencies->search > >Koha::Number::Price->_format_params calls >Koha::Acquisition::Currencies->get_active, which requests the DB. >The currency data should be mocked. > >Test plan: >sudo service mysql stop >prove t/Prices.t > should return green >--- > t/Prices.t | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > >diff --git a/t/Prices.t b/t/Prices.t >index 7ba1cc1..d6bfda2 100644 >--- a/t/Prices.t >+++ b/t/Prices.t >@@ -1,11 +1,10 @@ > use Modern::Perl; >-use Test::More tests => 16; >+use Test::More tests => 17; > use Test::MockModule; > > use t::lib::Mocks; > > BEGIN { >- my $context_module = t::lib::Mocks::mock_dbh; > use_ok('C4::Acquisition'); > use_ok('C4::Bookseller'); > use_ok('C4::Context'); >@@ -14,6 +13,23 @@ BEGIN { > > t::lib::Mocks::mock_preference( 'gist', '0.02|0.05|0.196' ); > >+use Test::DBIx::Class { >+ schema_class => 'Koha::Schema', >+ connect_info => ['dbi:SQLite:dbname=:memory:','',''], >+ connect_opts => { name_sep => '.', quote_char => '`', }, >+ fixture_class => '::Populate', >+}, 'Currency' ; >+ >+my $db = Test::MockModule->new('Koha::Database'); >+$db->mock( _new_schema => sub { return Schema(); } ); >+ >+fixtures_ok [ >+ Currency => [ >+ [ qw/ currency symbol rate active / ], >+ [[ 'my_cur', 'â¬', 1, 1, ]], >+ ], >+], 'add currency fixtures'; >+ > my $bookseller_module = Test::MockModule->new('Koha::Acquisition::Bookseller'); > > my ( $basketno_0_0, $basketno_1_1, $basketno_1_0, $basketno_0_1 ); >-- >2.7.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 15323
:
49678
|
49688
|
49695