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 => 23; |
24 |
use Test::More tests => 21; |
25 |
|
25 |
|
26 |
use C4::Branch; |
26 |
use C4::Branch; |
27 |
use Koha::Libraries; |
27 |
use Koha::Libraries; |
Lines 41-47
can_ok(
Link Here
|
41 |
GetBranchDetail |
41 |
GetBranchDetail |
42 |
ModBranch |
42 |
ModBranch |
43 |
GetBranchInfo |
43 |
GetBranchInfo |
44 |
GetBranchesInCategory |
|
|
45 |
mybranch |
44 |
mybranch |
46 |
) |
45 |
) |
47 |
); |
46 |
); |
Lines 249-286
$b2->{issuing} = undef;
Link Here
|
249 |
$b2->{categories} = \@cat; |
248 |
$b2->{categories} = \@cat; |
250 |
is_deeply( @$b2info[0], $b2, 'BRB has the category CAT1 and CAT2' ); |
249 |
is_deeply( @$b2info[0], $b2, 'BRB has the category CAT1 and CAT2' ); |
251 |
|
250 |
|
252 |
#Test GetBranchesInCategory |
|
|
253 |
my $brCat1 = GetBranchesInCategory( $cat1->{categorycode} ); |
254 |
my @b = ( $b2->{branchcode} ); |
255 |
is_deeply( $brCat1, \@b, 'CAT1 has branch BRB' ); |
256 |
|
257 |
my $b3 = { |
258 |
add => 1, |
259 |
branchcode => 'BRC', |
260 |
branchname => 'BranchC', |
261 |
branchaddress1 => 'adr1C', |
262 |
branchaddress2 => 'adr2C', |
263 |
branchaddress3 => 'adr3C', |
264 |
branchzip => 'zipC', |
265 |
branchcity => 'cityC', |
266 |
branchstate => 'stateC', |
267 |
branchcountry => 'countryC', |
268 |
branchphone => 'phoneC', |
269 |
branchfax => 'faxC', |
270 |
branchemail => 'emailC', |
271 |
branchurl => 'urlC', |
272 |
branchip => 'ipC', |
273 |
branchprinter => undef, |
274 |
branchnotes => 'noteC', |
275 |
opac_info => 'opacC', |
276 |
CAT1 => 1, |
277 |
CAT2 => 1 |
278 |
}; |
279 |
ModBranch($b3); |
280 |
$brCat1 = GetBranchesInCategory( $cat1->{categorycode} ); |
281 |
push( @b, $b3->{branchcode} ); |
282 |
is_deeply( $brCat1, \@b, 'CAT1 has branch BRB and BRC' ); |
283 |
|
284 |
#TODO later: test mybranchine and onlymine |
251 |
#TODO later: test mybranchine and onlymine |
285 |
# Actually we cannot mock C4::Context->userenv in unit tests |
252 |
# Actually we cannot mock C4::Context->userenv in unit tests |
286 |
|
253 |
|
287 |
- |
|
|