From 648ebe28cc65b62e804d33c65449eb7d466fb26b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 11 Jul 2024 11:40:35 +0200 Subject: [PATCH] Bug 37146: Add tests Signed-off-by: wainuiwitikapark --- t/db_dependent/FrameworkPlugin.t | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/FrameworkPlugin.t b/t/db_dependent/FrameworkPlugin.t index 679d69b953..731f97df6d 100755 --- a/t/db_dependent/FrameworkPlugin.t +++ b/t/db_dependent/FrameworkPlugin.t @@ -3,8 +3,9 @@ use Modern::Perl; use CGI; use File::Temp qw/tempfile/; use Getopt::Long; +use Test::More tests => 7; use Test::MockModule; -use Test::More tests => 6; +use Test::Warn; use t::lib::Mocks; use t::lib::TestBuilder; @@ -61,6 +62,19 @@ subtest 'Test06 -- test biblio_008' => sub { is( substr($field, 15, 3), '|||', 'Check country fallback for undefined' ); }; +subtest 'Test07 -- validate input' => sub { + plan tests => 4; + + my $plugin = Koha::FrameworkPlugin->new( { name => '../../misc/maintenance/touch_all_biblios.pl' } ); + warning_like { $plugin->launch } qr{Attempt to load}; + like( $plugin->errstr, qr{File not found} ); + + $plugin = Koha::FrameworkPlugin->new( { name => 'non-existent-plugin.pl' } ); + warning_like { $plugin->launch } q{}; + like( $plugin->errstr, qr{File not found} ); + +}; + $schema->storage->txn_rollback; sub test01 { -- 2.39.5