From 5dfb4426f79984cf468f839ef293e8867ac1d374 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 3 Dec 2015 14:12:22 +0000 Subject: [PATCH] Bug 15295: Koha::Libraries - Remove GetBranchCategory MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This has been replaced with Koha::Libraries->find Signed-off-by: Marc Véron Signed-off-by: Martin Renvoize http://bugs.koha-community.org/show_bug.cgi?id=15294 Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- C4/Branch.pm | 25 ------------------------- t/db_dependent/Branch.t | 16 +--------------- 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/C4/Branch.pm b/C4/Branch.pm index 14fcd20842..2397fd0fb3 100644 --- a/C4/Branch.pm +++ b/C4/Branch.pm @@ -28,7 +28,6 @@ BEGIN { $VERSION = 3.07.00.049; @ISA = qw(Exporter); @EXPORT = qw( - &GetBranchCategory &GetBranchName &GetBranch &GetBranches @@ -284,30 +283,6 @@ sub ModBranch { } } -=head2 GetBranchCategory - -$results = GetBranchCategory($categorycode); - -C<$results> is an hashref - -=cut - -sub GetBranchCategory { - my ($catcode) = @_; - return unless $catcode; - - my $dbh = C4::Context->dbh; - my $sth; - - $sth = $dbh->prepare(q{ - SELECT * - FROM branchcategories - WHERE categorycode = ? - }); - $sth->execute( $catcode ); - return $sth->fetchrow_hashref; -} - =head2 GetBranchCategories my $categories = GetBranchCategories($categorytype,$show_in_pulldown,$selected_in_pulldown); diff --git a/t/db_dependent/Branch.t b/t/db_dependent/Branch.t index c98ea1a5da..3ca302f5ac 100644 --- a/t/db_dependent/Branch.t +++ b/t/db_dependent/Branch.t @@ -21,7 +21,7 @@ use Modern::Perl; use C4::Context; use Data::Dumper; -use Test::More tests => 30; +use Test::More tests => 26; use C4::Branch; use Koha::Libraries; @@ -34,7 +34,6 @@ BEGIN { } can_ok( 'C4::Branch', qw( - GetBranchCategory GetBranchName GetBranch GetBranches @@ -209,25 +208,12 @@ delete $cat2->{add}; delete $new_category{add}; is_deeply($categories, [ $cat1,$cat2,\%new_category ], 'retrieve all expected library categories (bug 10515)'); -#test GetBranchCategory -my $cat1detail = GetBranchCategory( $cat1->{categorycode} ); -delete $cat1->{add}; -is_deeply( $cat1detail, $cat1, 'CAT1 details are right' ); -my $category = GetBranchCategory('LIBCATCODE'); -is_deeply($category, \%new_category, 'fetched newly added library category'); - my $del = Koha::LibraryCategories->find( $cat2->{categorycode} )->delete; is( $del, 1, 'One row affected' ); $categories = GetBranchCategories(); is( scalar( @$categories ), $count_cat + 2, "Category CAT2 deleted" ); -my $cat2detail = GetBranchCategory( $cat2->{categorycode} ); -is( $cat2detail, undef, 'CAT2 doesnt exist' ); - -$category = GetBranchCategory(); -is($category, undef, 'retrieve library category only if code is supplied (bug 10515)'); - $b2->{CAT1} = 1; ModBranch($b2); is( GetBranchesCount(), $count + 2, 'BRB added' ); -- 2.39.5