From 474a9b915c2053381ba528e55ab4ffffbf483f2f Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 29 Dec 2016 11:40:57 -0300 Subject: [PATCH] Bug 17825: (followup) Remove unused function AttributeTypeExists --- 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 77ba96cf9a..bfd1494ee8 100644 --- a/C4/Members/AttributeTypes.pm +++ b/C4/Members/AttributeTypes.pm @@ -90,22 +90,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 4b4d5a18b5..4721fad276 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.11.0