From f55c0039bdaff2eb3888d7e01be0e86044aca9cf 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit (cherry picked from commit 73e62a38f9c20f5ce1ab342940407d4969d5ba93) Signed-off-by: Frédéric Demians --- 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 c3031ac22f..ee9d006b32 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; @@ -58,6 +59,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