From a91aa7fdf355faeb36d0b309be11031df0e2eb14 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Sat, 30 Sep 2023 06:58:23 +0000 Subject: [PATCH] Bug 34970: Remove most modules from SuggestionEngine_AuthorityFile.t There is really no need for all those modules here. What remains, is just a trivial test. Test plan: Run t/SuggestionEngine_AuthorityFile.t Signed-off-by: Marcel de Rooy Signed-off-by: Katrin Fischer --- t/SuggestionEngine_AuthorityFile.t | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/t/SuggestionEngine_AuthorityFile.t b/t/SuggestionEngine_AuthorityFile.t index 486e9034a9..7790722f3f 100755 --- a/t/SuggestionEngine_AuthorityFile.t +++ b/t/SuggestionEngine_AuthorityFile.t @@ -20,30 +20,10 @@ # for every call to SearchAuthorities use Modern::Perl; - -use File::Spec; -use MARC::Record; - -use Test::More; +use Test::More tests => 2; use Test::MockModule; -use t::lib::Mocks; - -use Module::Load::Conditional qw/check_install/; - -BEGIN { - if ( check_install( module => 'Test::DBIx::Class' ) ) { - plan tests => 3; - } else { - plan skip_all => "Need Test::DBIx::Class" - } -} -# Mock the DB connexion -use Test::DBIx::Class; -my $db = Test::MockModule->new('Koha::Database'); -$db->mock( _new_schema => sub { return Schema(); } ); - -use_ok('Koha::SuggestionEngine'); +use Koha::SuggestionEngine; my $module = Test::MockModule->new('C4::AuthoritiesMarc'); $module->mock('SearchAuthorities', sub { @@ -68,6 +48,3 @@ is(ref($suggestor), 'Koha::SuggestionEngine', 'Created suggestion engine'); my $result = $suggestor->get_suggestions({search => 'Cookery'}); is_deeply($result, [ { 'search' => 'an:1234', 'relevance' => 1, 'label' => 'Cooking' } ], "Suggested correct alternative to 'Cookery'"); - -done_testing(); - -- 2.30.2