Bugzilla – Attachment 46999 Details for
Bug 15629
Move the C4::Branch related code to Koha::Libraries - part 3
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15629: Koha::Libraries - Remove GetBranchesInCategory (3)
Bug-15629-KohaLibraries---Remove-GetBranchesInCate.patch (text/plain), 3.20 KB, created by
Jonathan Druart
on 2016-01-20 14:36:40 UTC
(
hide
)
Description:
Bug 15629: Koha::Libraries - Remove GetBranchesInCategory (3)
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-01-20 14:36:40 UTC
Size:
3.20 KB
patch
obsolete
>From 7d2f0786c42a75b0c37e36529dd14c82e627ea72 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 20 Jan 2016 11:22:19 +0000 >Subject: [PATCH] Bug 15629: Koha::Libraries - Remove GetBranchesInCategory (3) > >C4::Branch::GetBranchesInCategory is not used anymore and can be >removed. > >Test plan: > git grep GetBranchesInCategory >should not return any result. >--- > C4/Branch.pm | 22 ---------------------- > t/db_dependent/Branch.t | 35 +---------------------------------- > 2 files changed, 1 insertion(+), 56 deletions(-) > >diff --git a/C4/Branch.pm b/C4/Branch.pm >index ae2216a..057a043 100644 >--- a/C4/Branch.pm >+++ b/C4/Branch.pm >@@ -36,7 +36,6 @@ BEGIN { > &GetBranchDetail > &ModBranch > &GetBranchInfo >- &GetBranchesInCategory > &mybranch > ); > @EXPORT_OK = qw( &onlymine &mybranch ); >@@ -310,27 +309,6 @@ sub GetBranchDetail { > return $sth->fetchrow_hashref(); > } > >-=head2 GetBranchesInCategory >- >- my $branches = GetBranchesInCategory($categorycode); >- >-Returns a href: keys %$branches eq (branchcode,branchname) . >- >-=cut >- >-sub GetBranchesInCategory { >- my ($categorycode) = @_; >- my @branches; >- my $dbh = C4::Context->dbh(); >- my $sth=$dbh->prepare( "SELECT b.branchcode FROM branchrelations r, branches b >- where r.branchcode=b.branchcode and r.categorycode=?"); >- $sth->execute($categorycode); >- while (my $branch = $sth->fetchrow) { >- push @branches, $branch; >- } >- return( \@branches ); >-} >- > =head2 GetBranchInfo > > $results = GetBranchInfo($branchcode); >diff --git a/t/db_dependent/Branch.t b/t/db_dependent/Branch.t >index 7c7ed75..72a59d4 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 => 23; >+use Test::More tests => 21; > > use C4::Branch; > use Koha::Libraries; >@@ -41,7 +41,6 @@ can_ok( > GetBranchDetail > ModBranch > GetBranchInfo >- GetBranchesInCategory > mybranch > ) > ); >@@ -249,38 +248,6 @@ $b2->{issuing} = undef; > $b2->{categories} = \@cat; > is_deeply( @$b2info[0], $b2, 'BRB has the category CAT1 and CAT2' ); > >-#Test GetBranchesInCategory >-my $brCat1 = GetBranchesInCategory( $cat1->{categorycode} ); >-my @b = ( $b2->{branchcode} ); >-is_deeply( $brCat1, \@b, 'CAT1 has branch BRB' ); >- >-my $b3 = { >- add => 1, >- branchcode => 'BRC', >- branchname => 'BranchC', >- branchaddress1 => 'adr1C', >- branchaddress2 => 'adr2C', >- branchaddress3 => 'adr3C', >- branchzip => 'zipC', >- branchcity => 'cityC', >- branchstate => 'stateC', >- branchcountry => 'countryC', >- branchphone => 'phoneC', >- branchfax => 'faxC', >- branchemail => 'emailC', >- branchurl => 'urlC', >- branchip => 'ipC', >- branchprinter => undef, >- branchnotes => 'noteC', >- opac_info => 'opacC', >- CAT1 => 1, >- CAT2 => 1 >-}; >-ModBranch($b3); >-$brCat1 = GetBranchesInCategory( $cat1->{categorycode} ); >-push( @b, $b3->{branchcode} ); >-is_deeply( $brCat1, \@b, 'CAT1 has branch BRB and BRC' ); >- > #TODO later: test mybranchine and onlymine > # Actually we cannot mock C4::Context->userenv in unit tests > >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15629
:
46997
|
46998
|
46999
|
47000
|
47001
|
47002
|
47518
|
47519
|
47520
|
47521
|
47522
|
47523
|
47553
|
47701
|
47706
|
47707
|
47708
|
47709
|
47710
|
47711
|
47712
|
47713