From 896e649e6a1ca5790275a7f5d35e4642afa06ffa Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 29 Dec 2016 11:40:57 -0300 Subject: [PATCH] [SIGNED-OFF] Bug 17825: (followup) Remove unused function AttributeTypeExists Signed-off-by: Owen Leonard --- C4/Members/AttributeTypes.pm | 16 ---------------- t/Members_AttributeTypes.t | 10 +--------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/C4/Members/AttributeTypes.pm b/C4/Members/AttributeTypes.pm index d4927db..5302eea 100644 --- a/C4/Members/AttributeTypes.pm +++ b/C4/Members/AttributeTypes.pm @@ -89,22 +89,6 @@ sub GetAttributeTypes_hashref { return \%hash; } -=head2 AttributeTypeExists - - my $have_attr_xyz = C4::Members::AttributeTypes::AttributeTypeExists($code) - -Returns true if we have attribute type C<$code> -in the database. - -=cut - -sub AttributeTypeExists { - my ($code) = @_; - my $dbh = C4::Context->dbh; - my $exists = $dbh->selectrow_array("SELECT code FROM borrower_attribute_types WHERE code = ?", undef, $code); - return $exists; -} - =head1 METHODS my $attr_type = C4::Members::AttributeTypes->new($code, $description); diff --git a/t/Members_AttributeTypes.t b/t/Members_AttributeTypes.t index 4b4d5a1..4721fad 100755 --- a/t/Members_AttributeTypes.t +++ b/t/Members_AttributeTypes.t @@ -24,7 +24,7 @@ use Module::Load::Conditional qw/check_install/; BEGIN { if ( check_install( module => 'Test::DBIx::Class' ) ) { - plan tests => 10; + plan tests => 8; } else { plan skip_all => "Need Test::DBIx::Class" } @@ -74,14 +74,6 @@ is( $members_attributetypes[0]->{'class'}, is( $members_attributetypes[1]->{'class'}, 'silver', 'Second class value is silver' ); -ok( C4::Members::AttributeTypes::AttributeTypeExists('one'), - 'checking an attribute type exists' ); - -ok( - !C4::Members::AttributeTypes::AttributeTypeExists('three'), - "checking a attribute that isn't in the code doesn't exist" -); - ok( C4::Members::AttributeTypes->fetch('one'), "testing fetch feature" ); ok( !C4::Members::AttributeTypes->fetch('FAKE'), -- 2.1.4