Bugzilla – Attachment 156490 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.87 KB, created by
Katrin Fischer
on 2023-10-03 10:07:34 UTC
(
hide
)
Description:
Bug 34970: Remove most modules from SuggestionEngine_AuthorityFile.t
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-10-03 10:07:34 UTC
Size:
1.87 KB
patch
obsolete
>From a91aa7fdf355faeb36d0b309be11031df0e2eb14 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 > >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> >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > 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