1 package KohaTest::Branch::GetBranches;
2 use base qw( KohaTest::Branch );
11 =head2 STARTUP METHODS
13 These get run once, before the main test methods in this module
23 When you pass in something true to GetBranches, it limits the
24 response to only your branch.
28 sub onlymine : Test( 4 ) {
31 # C4::Branch::GetBranches uses this variable, so make sure it exists.
32 ok( C4::Context->userenv->{'branch'}, 'we have a branch' );
33 my $branches = C4::Branch::GetBranches( 'onlymine' );
34 # diag( Data::Dumper->Dump( [ $branches ], [ 'branches' ] ) );
35 is( scalar( keys %$branches ), 1, 'one key for our branch only' );
36 ok( exists $branches->{ C4::Context->userenv->{'branch'} }, 'my branch was returned' );
37 is( $branches->{ C4::Context->userenv->{'branch'} }->{'branchcode'}, C4::Context->userenv->{'branch'}, 'branchcode' );