Lines 315-338
subtest 'Koha::Exceptions::Plugin tests' => sub {
Link Here
|
315 |
use_ok("Koha::Exceptions::Plugin"); |
315 |
use_ok("Koha::Exceptions::Plugin"); |
316 |
|
316 |
|
317 |
my $plugin_class = 'yahey'; |
317 |
my $plugin_class = 'yahey'; |
|
|
318 |
my $error_string = 'This is an error'; |
318 |
|
319 |
|
319 |
throws_ok { |
320 |
throws_ok { |
320 |
Koha::Exceptions::Plugin::InstallDied->throw( plugin_class => $plugin_class ); |
321 |
Koha::Exceptions::Plugin::InstallDied->throw( |
|
|
322 |
plugin_class => $plugin_class, |
323 |
install_error => $error_string, |
324 |
); |
321 |
} |
325 |
} |
322 |
'Koha::Exceptions::Plugin::InstallDied', |
326 |
'Koha::Exceptions::Plugin::InstallDied', |
323 |
'Exception is thrown :-D'; |
327 |
'Exception is thrown :-D'; |
324 |
|
328 |
|
325 |
# stringify the exception |
329 |
# stringify the exception |
326 |
is( "$@", "Calling 'install' died for plugin $plugin_class", 'Exception stringified correctly' ); |
330 |
is( "$@", "Calling 'install' died for plugin $plugin_class: $error_string", 'Exception stringified correctly' ); |
327 |
|
331 |
|
328 |
throws_ok { |
332 |
throws_ok { |
329 |
Koha::Exceptions::Plugin::UpgradeDied->throw( plugin_class => $plugin_class ); |
333 |
Koha::Exceptions::Plugin::UpgradeDied->throw( |
|
|
334 |
plugin_class => $plugin_class, |
335 |
upgrade_error => $error_string, |
336 |
); |
330 |
} |
337 |
} |
331 |
'Koha::Exceptions::Plugin::UpgradeDied', |
338 |
'Koha::Exceptions::Plugin::UpgradeDied', |
332 |
'Exception is thrown :-D'; |
339 |
'Exception is thrown :-D'; |
333 |
|
340 |
|
334 |
# stringify the exception |
341 |
# stringify the exception |
335 |
is( "$@", "Calling 'upgrade' died for plugin $plugin_class", 'Exception stringified correctly' ); |
342 |
is( "$@", "Calling 'upgrade' died for plugin $plugin_class: $error_string", 'Exception stringified correctly' ); |
336 |
}; |
343 |
}; |
337 |
|
344 |
|
338 |
subtest 'Koha::Exceptions::Booking tests' => sub { |
345 |
subtest 'Koha::Exceptions::Booking tests' => sub { |
339 |
- |
|
|