Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 5; |
22 |
use Test::More tests => 7; |
23 |
|
23 |
|
24 |
use Koha::Database; |
24 |
use Koha::Database; |
25 |
use Koha::Patron::Category; |
25 |
use Koha::Patron::Category; |
Lines 40-45
$new_category_1->add_branch_limitation( $branch->{branchcode} );
Link Here
|
40 |
my $new_category_2 = Koha::Patron::Category->new({ |
40 |
my $new_category_2 = Koha::Patron::Category->new({ |
41 |
categorycode => 'mycatcodeY', |
41 |
categorycode => 'mycatcodeY', |
42 |
description => 'mycatdescY', |
42 |
description => 'mycatdescY', |
|
|
43 |
checkprevcheckout => undef, |
43 |
})->store; |
44 |
})->store; |
44 |
|
45 |
|
45 |
is( Koha::Patron::Categories->search->count, $nb_of_categories + 2, 'The 2 patron categories should have been added' ); |
46 |
is( Koha::Patron::Categories->search->count, $nb_of_categories + 2, 'The 2 patron categories should have been added' ); |
Lines 49-54
is( $retrieved_category_1->categorycode, $new_category_1->categorycode, 'Find a
Link Here
|
49 |
is_deeply( $retrieved_category_1->branch_limitations, [ $branch->{branchcode} ], 'The branch limitation should have been stored and retrieved' ); |
50 |
is_deeply( $retrieved_category_1->branch_limitations, [ $branch->{branchcode} ], 'The branch limitation should have been stored and retrieved' ); |
50 |
is_deeply( $retrieved_category_1->default_messaging, [], 'By default there is not messaging option' ); |
51 |
is_deeply( $retrieved_category_1->default_messaging, [], 'By default there is not messaging option' ); |
51 |
|
52 |
|
|
|
53 |
my $retrieved_category_2 = Koha::Patron::Categories->find( $new_category_2->categorycode ); |
54 |
is( $retrieved_category_1->checkprevcheckout, 'inherit', 'Koha::Patron::Category->store should default checkprevcheckout to inherit' ); |
55 |
is( $retrieved_category_2->checkprevcheckout, 'inherit', 'Koha::Patron::Category->store should default checkprevcheckout to inherit' ); |
56 |
|
52 |
$retrieved_category_1->delete; |
57 |
$retrieved_category_1->delete; |
53 |
is( Koha::Patron::Categories->search->count, $nb_of_categories + 1, 'Delete should have deleted the patron category' ); |
58 |
is( Koha::Patron::Categories->search->count, $nb_of_categories + 1, 'Delete should have deleted the patron category' ); |
54 |
|
59 |
|
55 |
- |
|
|