|
Lines 21-27
use Modern::Perl;
Link Here
|
| 21 |
use C4::Context; |
21 |
use C4::Context; |
| 22 |
use Data::Dumper; |
22 |
use Data::Dumper; |
| 23 |
|
23 |
|
| 24 |
use Test::More tests => 34; |
24 |
use Test::More tests => 30; |
| 25 |
|
25 |
|
| 26 |
use C4::Branch; |
26 |
use C4::Branch; |
| 27 |
use Koha::Libraries; |
27 |
use Koha::Libraries; |
|
Lines 42-48
can_ok(
Link Here
|
| 42 |
GetBranchDetail |
42 |
GetBranchDetail |
| 43 |
get_branchinfos_of |
43 |
get_branchinfos_of |
| 44 |
ModBranch |
44 |
ModBranch |
| 45 |
CheckBranchCategorycode |
|
|
| 46 |
GetBranchInfo |
45 |
GetBranchInfo |
| 47 |
GetCategoryTypes |
46 |
GetCategoryTypes |
| 48 |
GetBranchCategories |
47 |
GetBranchCategories |
|
Lines 229-247
is( $cat2detail, undef, 'CAT2 doesnt exist' );
Link Here
|
| 229 |
$category = GetBranchCategory(); |
228 |
$category = GetBranchCategory(); |
| 230 |
is($category, undef, 'retrieve library category only if code is supplied (bug 10515)'); |
229 |
is($category, undef, 'retrieve library category only if code is supplied (bug 10515)'); |
| 231 |
|
230 |
|
| 232 |
#Test CheckBranchCategoryCode |
|
|
| 233 |
my $check1 = CheckBranchCategorycode( $cat1->{categorycode} ); |
| 234 |
my $check2 = CheckBranchCategorycode( $cat2->{categorycode} ); |
| 235 |
like( $check1, '/^\d+$/', "CheckBranchCategorycode returns a number" ); |
| 236 |
|
| 237 |
$b2->{CAT1} = 1; |
231 |
$b2->{CAT1} = 1; |
| 238 |
ModBranch($b2); |
232 |
ModBranch($b2); |
| 239 |
is( GetBranchesCount(), $count + 2, 'BRB added' ); |
233 |
is( GetBranchesCount(), $count + 2, 'BRB added' ); |
| 240 |
is( |
|
|
| 241 |
CheckBranchCategorycode( $cat1->{categorycode} ), |
| 242 |
$check1 + 1, |
| 243 |
'BRB added to CAT1' |
| 244 |
); |
| 245 |
|
234 |
|
| 246 |
#Test GetBranchInfo |
235 |
#Test GetBranchInfo |
| 247 |
my $b1info = GetBranchInfo( $b1->{branchcode} ); |
236 |
my $b1info = GetBranchInfo( $b1->{branchcode} ); |
|
Lines 284-294
$b2 = {
Link Here
|
| 284 |
}; |
273 |
}; |
| 285 |
ModBranch($b2); |
274 |
ModBranch($b2); |
| 286 |
$b2info = GetBranchInfo( $b2->{branchcode} ); |
275 |
$b2info = GetBranchInfo( $b2->{branchcode} ); |
| 287 |
is( |
|
|
| 288 |
CheckBranchCategorycode( $cat2->{categorycode} ), |
| 289 |
$check2 + 1, |
| 290 |
'BRB added to CAT2' |
| 291 |
); |
| 292 |
push( @cat, $cat2->{categorycode} ); |
276 |
push( @cat, $cat2->{categorycode} ); |
| 293 |
delete $b2->{CAT1}; |
277 |
delete $b2->{CAT1}; |
| 294 |
delete $b2->{CAT2}; |
278 |
delete $b2->{CAT2}; |
|
Lines 327-337
ModBranch($b3);
Link Here
|
| 327 |
$brCat1 = GetBranchesInCategory( $cat1->{categorycode} ); |
311 |
$brCat1 = GetBranchesInCategory( $cat1->{categorycode} ); |
| 328 |
push( @b, $b3->{branchcode} ); |
312 |
push( @b, $b3->{branchcode} ); |
| 329 |
is_deeply( $brCat1, \@b, 'CAT1 has branch BRB and BRC' ); |
313 |
is_deeply( $brCat1, \@b, 'CAT1 has branch BRB and BRC' ); |
| 330 |
is( |
|
|
| 331 |
CheckBranchCategorycode( $cat1->{categorycode} ), |
| 332 |
$check1 + 2, |
| 333 |
'BRC has been added to CAT1' |
| 334 |
); |
| 335 |
|
314 |
|
| 336 |
#Test GetCategoryTypes |
315 |
#Test GetCategoryTypes |
| 337 |
my @category_types = GetCategoryTypes(); |
316 |
my @category_types = GetCategoryTypes(); |
| 338 |
- |
|
|