Lines 17-24
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 63; |
20 |
use Test::More tests => 64; |
21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
|
|
22 |
use Test::Exception; |
23 |
|
22 |
use Data::Dumper qw/Dumper/; |
24 |
use Data::Dumper qw/Dumper/; |
23 |
use C4::Context; |
25 |
use C4::Context; |
24 |
use Koha::Database; |
26 |
use Koha::Database; |
Lines 501-503
subtest 'Trivial test for AddMember_Auto' => sub {
Link Here
|
501 |
}; |
503 |
}; |
502 |
|
504 |
|
503 |
$schema->storage->txn_rollback; |
505 |
$schema->storage->txn_rollback; |
504 |
- |
506 |
|
|
|
507 |
subtest 'AddMember (invalid categorycode) tests' => sub { |
508 |
plan tests => 1; |
509 |
|
510 |
$schema->storage->txn_begin; |
511 |
|
512 |
my $category = $builder->build_object({ class => 'Koha::Patron::Categories' }); |
513 |
my $category_id = $category->id; |
514 |
# Remove category to make sure the id is not on the DB |
515 |
$category->delete; |
516 |
|
517 |
my $patron_data = { |
518 |
categorycode => $category_id |
519 |
}; |
520 |
|
521 |
throws_ok |
522 |
{ AddMember( %{ $patron_data } ); } |
523 |
'Koha::Exceptions::BadParameter', |
524 |
'AddMember raises an exception on invalid categorycode'; |
525 |
|
526 |
$schema->storage->txn_rollback; |
527 |
}; |