Bugzilla – Attachment 156438 Details for
Bug 34970
t/SuggestionEngine_AuthorityFile.t does not do anything with Test::DBIx::Class
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34970: Remove most modules from SuggestionEngine_AuthorityFile.t
Bug-34970-Remove-most-modules-from-SuggestionEngin.patch (text/plain), 1.86 KB, created by
Marcel de Rooy
on 2023-09-30 07:01:00 UTC
(
hide
)
Description:
Bug 34970: Remove most modules from SuggestionEngine_AuthorityFile.t
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-09-30 07:01:00 UTC
Size:
1.86 KB
patch
obsolete
>From e2983eba6d5696412e675c43adb26486dd91f80c Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Sat, 30 Sep 2023 06:58:23 +0000 >Subject: [PATCH] Bug 34970: Remove most modules from > SuggestionEngine_AuthorityFile.t >Content-Type: text/plain; charset=utf-8 > >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 <m.de.rooy@rijksmuseum.nl> >--- > 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
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 34970
:
156438
|
156490