From ed7c923d0f8e6dba97a51d93438a08194487ad95 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 9 Feb 2017 13:13:50 +0100 Subject: [PATCH] Bug 18089: Remove warnings from tests using DBIx::Class fixtures Signed-off-by: Jonathan Druart --- t/XSLT.t | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/t/XSLT.t b/t/XSLT.t index 7e7ed06..7136375 100755 --- a/t/XSLT.t +++ b/t/XSLT.t @@ -16,18 +16,38 @@ # along with Koha; if not, see . use Modern::Perl; +use Test::More; -use Test::More tests => 9; use File::Temp; use File::Path qw/make_path/; use t::lib::Mocks; +use Module::Load::Conditional qw/check_install/; + BEGIN { - my $context_module = t::lib::Mocks::mock_dbh; + if ( check_install( module => 'Test::DBIx::Class' ) ) { + plan tests => 10; + } else { + plan skip_all => "Need Test::DBIx::Class" + } + use_ok('C4::XSLT'); }; +use Test::DBIx::Class { + schema_class => 'Koha::Schema', + connect_info => ['dbi:SQLite:dbname=:memory:','',''], + connect_opts => { name_sep => '.', quote_char => '`', }, + fixture_class => '::Populate', +}, 'Branch' ; + +fixtures_ok [ + Branch => [ + ], +]; + + my $dir = File::Temp->newdir(); my @themes = ('prog', 'test'); my @langs = ('en', 'es-ES'); -- 2.9.3