Lines 3-9
Link Here
|
3 |
use Modern::Perl; |
3 |
use Modern::Perl; |
4 |
|
4 |
|
5 |
use Test::NoWarnings; |
5 |
use Test::NoWarnings; |
6 |
use Test::More tests => 19; |
6 |
use Test::More tests => 20; |
7 |
use Test::Warn; |
7 |
use Test::Warn; |
8 |
use CGI; |
8 |
use CGI; |
9 |
use File::Basename; |
9 |
use File::Basename; |
Lines 92-95
is( $plugin->get_plugins_opac_head, q{}, 'Test plugin opac_head return value
Link Here
|
92 |
is( $plugin->get_plugins_intranet_js, q{}, 'Test plugin intranet_js return value is empty' ); |
92 |
is( $plugin->get_plugins_intranet_js, q{}, 'Test plugin intranet_js return value is empty' ); |
93 |
is( $plugin->get_plugins_intranet_head, q{}, 'Test plugin intranet_head return value is empty' ); |
93 |
is( $plugin->get_plugins_intranet_head, q{}, 'Test plugin intranet_head return value is empty' ); |
94 |
|
94 |
|
|
|
95 |
# Test intranet_js page parameter passing |
96 |
t::lib::Mocks::mock_config( 'enable_plugins', 1 ); |
97 |
|
98 |
# Reset the mock to capture arguments |
99 |
my $captured_args; |
100 |
$mock_plugin->mock( |
101 |
'intranet_js', |
102 |
sub { |
103 |
my ( $self, $args ) = @_; |
104 |
$captured_args = $args; |
105 |
return "test"; |
106 |
} |
107 |
); |
108 |
|
109 |
# Create plugin with context (minimal) |
110 |
my $plugin_with_context = bless {}, 'Koha::Template::Plugin::KohaPlugins'; |
111 |
|
112 |
# Call get_plugins_intranet_js |
113 |
my $result = $plugin_with_context->get_plugins_intranet_js(); |
114 |
|
115 |
# Verify that the plugin was called with page parameter containing script name |
116 |
ok( |
117 |
defined $captured_args && ref($captured_args) eq 'HASH' && exists $captured_args->{page}, |
118 |
'Plugin intranet_js method receives page parameter with script name' |
119 |
); |
120 |
|
95 |
$schema->storage->txn_rollback; |
121 |
$schema->storage->txn_rollback; |
96 |
- |
|
|