From 988e9430a402ca04ec7563f49d6cc43c2737c46a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 4 Nov 2016 13:49:57 +0000 Subject: [PATCH] Bug 17552: Continue revert and add tests to highlight the problem Signed-off-by: Josef Moravec Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- Koha/Objects.pm | 4 ++-- t/db_dependent/Koha/Objects.t | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Koha/Objects.pm b/Koha/Objects.pm index da2f2c969d..56f165c27d 100644 --- a/Koha/Objects.pm +++ b/Koha/Objects.pm @@ -292,14 +292,14 @@ The autoload method is used call DBIx::Class method on a resultset. Important: If you plan to use one of the DBIx::Class methods you must provide relevant tests in t/db_dependent/Koha/Objects.t -Currently count, pager, reset, update and delete are covered. +Currently count, pager, update and delete are covered. =cut sub AUTOLOAD { my ( $self, @params ) = @_; - my @known_methods = qw( count pager reset update delete result_class ); + my @known_methods = qw( count pager update delete result_class ); my $method = our $AUTOLOAD; $method =~ s/.*:://; diff --git a/t/db_dependent/Koha/Objects.t b/t/db_dependent/Koha/Objects.t index de36f54944..84b1a861c5 100644 --- a/t/db_dependent/Koha/Objects.t +++ b/t/db_dependent/Koha/Objects.t @@ -64,11 +64,13 @@ subtest 'pager' => sub { }; subtest 'reset' => sub { - plan tests => 1; + plan tests => 3; my $patrons = Koha::Patrons->search; my $first_borrowernumber = $patrons->next->borrowernumber; my $second_borrowernumber = $patrons->next->borrowernumber; + is( ref( $patrons->reset ), 'Koha::Patrons', 'Koha::Objects->reset should allow chaining' ); + is( ref( $patrons->reset->next ), 'Koha::Patron', 'Koha::Objects->reset should allow chaining' ); is( $patrons->reset->next->borrowernumber, $first_borrowernumber, 'Koha::Objects->reset should work as expected'); }; -- 2.39.5