From b7d25c83e6a39c75804c18c07ac76231d43b57b9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 30 Aug 2016 16:22:53 +0100 Subject: [PATCH] Bug 17226: Make Koha::Object->get_column available Signed-off-by: Claire Gravely Signed-off-by: Brendan Gallagher --- Koha/Object.pm | 2 +- t/db_dependent/Koha/Object.t | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Koha/Object.pm b/Koha/Object.pm index a82f80e61a..cf55089c06 100644 --- a/Koha/Object.pm +++ b/Koha/Object.pm @@ -237,7 +237,7 @@ sub AUTOLOAD { } } - my @known_methods = qw( is_changed id in_storage ); + my @known_methods = qw( is_changed id in_storage get_column ); carp "The method $method is not covered by tests or does not exist!" and return unless grep {/^$method$/} @known_methods; diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t index a8eadedfc2..4b0a1c4513 100755 --- a/t/db_dependent/Koha/Object.t +++ b/t/db_dependent/Koha/Object.t @@ -17,7 +17,7 @@ use Modern::Perl; -use Test::More tests => 5; +use Test::More tests => 6; use Test::Warn; use C4::Context; @@ -84,4 +84,9 @@ subtest 'id' => sub { is( $patron->id, $patron->borrowernumber ); }; +subtest 'get_column' => sub { + plan tests => 1; + my $patron = Koha::Patron->new({categorycode => $categorycode, branchcode => $branchcode })->store; + is( $patron->get_column('borrowernumber'), $patron->borrowernumber, 'get_column should retrieve the correct value' ); +}; 1; -- 2.39.5