Lines 410-416
subtest '_load_configuration' => sub {
Link Here
|
410 |
|
410 |
|
411 |
subtest 'Final tests' => sub { |
411 |
subtest 'Final tests' => sub { |
412 |
|
412 |
|
413 |
plan tests => 10; |
413 |
plan tests => 9; |
414 |
|
414 |
|
415 |
$schema->storage->txn_begin; |
415 |
$schema->storage->txn_begin; |
416 |
|
416 |
|
Lines 419-430
subtest 'Final tests' => sub {
Link Here
|
419 |
my $config = Koha::Illrequest::Config->new; |
419 |
my $config = Koha::Illrequest::Config->new; |
420 |
|
420 |
|
421 |
# getPrefixes (error & undef): |
421 |
# getPrefixes (error & undef): |
422 |
dies_ok( sub { $config->getPrefixes("FOO") }, "getPrefixes: die if not correct type."); |
422 |
is($config->getPrefixes(), undef, |
423 |
is_deeply($config->getPrefixes("brw_cat"), { default => undef}, |
|
|
424 |
"getPrefixes: Undefined brw_cat prefix is undefined."); |
425 |
is_deeply($config->getPrefixes("branch"), { default => undef}, |
426 |
"getPrefixes: Undefined branch prefix is undefined."); |
423 |
"getPrefixes: Undefined branch prefix is undefined."); |
427 |
|
424 |
|
|
|
425 |
is($config->has_branch(), undef, "Config does not have branch when no config loaded"); |
426 |
|
428 |
# getDigitalRecipients (error & undef): |
427 |
# getDigitalRecipients (error & undef): |
429 |
dies_ok( sub { $config->getDigitalRecipients("FOO") }, |
428 |
dies_ok( sub { $config->getDigitalRecipients("FOO") }, |
430 |
"getDigitalRecipients: die if not correct type."); |
429 |
"getDigitalRecipients: die if not correct type."); |
Lines 449-459
subtest 'Final tests' => sub {
Link Here
|
449 |
); |
448 |
); |
450 |
|
449 |
|
451 |
# getPrefixes (values): |
450 |
# getPrefixes (values): |
452 |
is_deeply($config->getPrefixes("brw_cat"), |
451 |
is_deeply($config->getPrefixes(), |
453 |
{ B => '2-prefix', default => 'DEFAULT-prefix' }, |
452 |
{ '1' => 'T-prefix' }, |
454 |
"getPrefixes: return configuration brw_cat prefixes."); |
|
|
455 |
is_deeply($config->getPrefixes("branch"), |
456 |
{ 1 => 'T-prefix', default => 'DEFAULT-prefix' }, |
457 |
"getPrefixes: return configuration branch prefixes."); |
453 |
"getPrefixes: return configuration branch prefixes."); |
458 |
|
454 |
|
459 |
# getDigitalRecipients (values): |
455 |
# getDigitalRecipients (values): |
Lines 464-469
subtest 'Final tests' => sub {
Link Here
|
464 |
{ 2 => 'borrower', default => 'branch' }, |
460 |
{ 2 => 'borrower', default => 'branch' }, |
465 |
"getDigitalRecipients: return branch digital_recipients."); |
461 |
"getDigitalRecipients: return branch digital_recipients."); |
466 |
|
462 |
|
|
|
463 |
# has_branch test |
464 |
ok($config->has_branch(), "has_branch returns true if branch defined in configuration"); |
465 |
|
467 |
$schema->storage->txn_rollback; |
466 |
$schema->storage->txn_rollback; |
468 |
}; |
467 |
}; |
469 |
|
468 |
|
470 |
- |
|
|