Lines 35-40
use Koha::Plugins::Methods;
Link Here
|
35 |
|
35 |
|
36 |
use t::lib::Mocks; |
36 |
use t::lib::Mocks; |
37 |
|
37 |
|
|
|
38 |
my $builder = t::lib::TestBuilder->new; |
39 |
|
38 |
BEGIN { |
40 |
BEGIN { |
39 |
# Mock pluginsdir before loading Plugins module |
41 |
# Mock pluginsdir before loading Plugins module |
40 |
my $path = dirname(__FILE__) . '/../../../lib/plugins'; |
42 |
my $path = dirname(__FILE__) . '/../../../lib/plugins'; |
Lines 258-263
subtest 'Koha::Plugin::Test' => sub {
Link Here
|
258 |
ok( can_load( modules => { "Koha::Plugin::Test" => undef } ), 'Test can_load' ); |
260 |
ok( can_load( modules => { "Koha::Plugin::Test" => undef } ), 'Test can_load' ); |
259 |
|
261 |
|
260 |
my $plugin = Koha::Plugin::Test->new( { enable_plugins => 1, cgi => CGI->new } ); |
262 |
my $plugin = Koha::Plugin::Test->new( { enable_plugins => 1, cgi => CGI->new } ); |
|
|
263 |
my $biblio = $builder->build_sample_biblio; |
261 |
|
264 |
|
262 |
isa_ok( $plugin, "Koha::Plugin::Test", 'Test plugin class' ); |
265 |
isa_ok( $plugin, "Koha::Plugin::Test", 'Test plugin class' ); |
263 |
isa_ok( $plugin, "Koha::Plugins::Base", 'Test plugin parent class' ); |
266 |
isa_ok( $plugin, "Koha::Plugins::Base", 'Test plugin parent class' ); |
Lines 266-272
subtest 'Koha::Plugin::Test' => sub {
Link Here
|
266 |
ok( $plugin->can('tool'), 'Test plugin can tool' ); |
269 |
ok( $plugin->can('tool'), 'Test plugin can tool' ); |
267 |
ok( $plugin->can('to_marc'), 'Test plugin can to_marc' ); |
270 |
ok( $plugin->can('to_marc'), 'Test plugin can to_marc' ); |
268 |
ok( $plugin->can('intranet_catalog_biblio_enhancements'), 'Test plugin can intranet_catalog_biblio_enhancements' ); |
271 |
ok( $plugin->can('intranet_catalog_biblio_enhancements'), 'Test plugin can intranet_catalog_biblio_enhancements' ); |
269 |
is( $plugin->intranet_catalog_biblio_enhancements_toolbar_button({ biblionumber => $biblionumber }), $biblionumber, 'Test plugin can intranet_catalog_biblio_enhancements_toolbar_button with biblionumber parameter'); |
272 |
is( $plugin->intranet_catalog_biblio_enhancements_toolbar_button({ biblionumber => $biblio->biblionumber }), $biblio->biblionumber, 'Test plugin can intranet_catalog_biblio_enhancements_toolbar_button with biblionumber parameter'); |
270 |
ok( $plugin->can('opac_online_payment'), 'Test plugin can opac_online_payment' ); |
273 |
ok( $plugin->can('opac_online_payment'), 'Test plugin can opac_online_payment' ); |
271 |
ok( $plugin->can('after_hold_create'), 'Test plugin can after_hold_create' ); |
274 |
ok( $plugin->can('after_hold_create'), 'Test plugin can after_hold_create' ); |
272 |
ok( $plugin->can('before_send_messages'), 'Test plugin can before_send_messages' ); |
275 |
ok( $plugin->can('before_send_messages'), 'Test plugin can before_send_messages' ); |
273 |
- |
|
|