|
Lines 43-49
can_ok(
Link Here
|
| 43 |
ModBranch |
43 |
ModBranch |
| 44 |
GetBranchInfo |
44 |
GetBranchInfo |
| 45 |
GetBranchesInCategory |
45 |
GetBranchesInCategory |
| 46 |
ModBranchCategoryInfo |
|
|
| 47 |
mybranch |
46 |
mybranch |
| 48 |
) |
47 |
) |
| 49 |
); |
48 |
); |
|
Lines 166-172
is_deeply( $branchdetail, $b1 , "GetBranchDetail gives the details of BRA");
Link Here
|
| 166 |
my $count_cat = Koha::LibraryCategories->search->count; |
165 |
my $count_cat = Koha::LibraryCategories->search->count; |
| 167 |
|
166 |
|
| 168 |
my $cat1 = { |
167 |
my $cat1 = { |
| 169 |
add => 1, |
|
|
| 170 |
categorycode => 'CAT1', |
168 |
categorycode => 'CAT1', |
| 171 |
categoryname => 'catname1', |
169 |
categoryname => 'catname1', |
| 172 |
codedescription => 'catdesc1', |
170 |
codedescription => 'catdesc1', |
|
Lines 174-180
my $cat1 = {
Link Here
|
| 174 |
show_in_pulldown => 1 |
172 |
show_in_pulldown => 1 |
| 175 |
}; |
173 |
}; |
| 176 |
my $cat2 = { |
174 |
my $cat2 = { |
| 177 |
add => 1, |
|
|
| 178 |
categorycode => 'CAT2', |
175 |
categorycode => 'CAT2', |
| 179 |
categoryname => 'catname2', |
176 |
categoryname => 'catname2', |
| 180 |
categorytype => 'catype2', |
177 |
categorytype => 'catype2', |
|
Lines 190-208
my %new_category = (
Link Here
|
| 190 |
show_in_pulldown => 1, |
187 |
show_in_pulldown => 1, |
| 191 |
); |
188 |
); |
| 192 |
|
189 |
|
| 193 |
ModBranchCategoryInfo({ |
190 |
Koha::LibraryCategory->new(\%new_category)->store; |
| 194 |
add => 1, |
191 |
Koha::LibraryCategory->new($cat1)->store; |
| 195 |
%new_category, |
192 |
Koha::LibraryCategory->new($cat2)->store; |
| 196 |
}); |
|
|
| 197 |
|
| 198 |
ModBranchCategoryInfo($cat1); |
| 199 |
ModBranchCategoryInfo($cat2); |
| 200 |
|
193 |
|
| 201 |
my $categories = Koha::LibraryCategories->search; |
194 |
my $categories = Koha::LibraryCategories->search; |
| 202 |
is( $categories->count, $count_cat + 3, "Two categories added" ); |
195 |
is( $categories->count, $count_cat + 3, "Two categories added" ); |
| 203 |
delete $cat1->{add}; |
|
|
| 204 |
delete $cat2->{add}; |
| 205 |
delete $new_category{add}; |
| 206 |
|
196 |
|
| 207 |
my $del = Koha::LibraryCategories->find( $cat2->{categorycode} )->delete; |
197 |
my $del = Koha::LibraryCategories->find( $cat2->{categorycode} )->delete; |
| 208 |
is( $del, 1, 'One row affected' ); |
198 |
is( $del, 1, 'One row affected' ); |
|
Lines 226-233
$b2->{issuing} = undef;
Link Here
|
| 226 |
$b2->{categories} = \@cat; |
216 |
$b2->{categories} = \@cat; |
| 227 |
is_deeply( @$b2info[0], $b2, 'BRB has the category CAT1' ); |
217 |
is_deeply( @$b2info[0], $b2, 'BRB has the category CAT1' ); |
| 228 |
|
218 |
|
| 229 |
ModBranchCategoryInfo({add => 1,%$cat2}); |
219 |
Koha::LibraryCategory->new($cat2)->store; |
| 230 |
is( Koha::LibraryCategories->search->count, $count_cat + 3, "Two catgories added" ); |
220 |
is( Koha::LibraryCategories->search->count, $count_cat + 3, "Two categories added" ); |
| 231 |
$b2 = { |
221 |
$b2 = { |
| 232 |
branchcode => 'BRB', |
222 |
branchcode => 'BRB', |
| 233 |
branchname => 'BranchB', |
223 |
branchname => 'BranchB', |
| 234 |
- |
|
|