From 48501720658f667c3fc1e28b57993d387acd3ae4 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Mon, 10 Jul 2017 17:46:29 +0300 Subject: [PATCH] Bug 18231: (follow-up) Fix t/db_dependent/Koha/Objects.t This Bug broke a test in t/db_dependent/Koha/Objects.t. This patch replaces now failing test with an equal one but targetting a different Koha-object. To test: 1. Apply first & second patch in this Bug and run updatedatabase.pl 2. prove t/db_dependent/Koha/Objects.t 3. Observe following failure: DBIx::Class::ResultSet::find(): find() expects either a column/value hashref, or a list of values corresponding to the columns of the specified unique constraint 'primary' at /home/koha/Koha/Koha/Objects.pm line 227 4. Apply this patch 5. prove t/db_dependent/Koha/Objects.t 6. Observe test passing --- t/db_dependent/Koha/Objects.t | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/t/db_dependent/Koha/Objects.t b/t/db_dependent/Koha/Objects.t index f5f9472..a4764d0 100644 --- a/t/db_dependent/Koha/Objects.t +++ b/t/db_dependent/Koha/Objects.t @@ -24,7 +24,7 @@ use Test::Warn; use Koha::Authority::Types; use Koha::Cities; -use Koha::IssuingRules; +use Koha::Notice::Templates; use Koha::Patron::Category; use Koha::Patron::Categories; use Koha::Patrons; @@ -135,9 +135,12 @@ subtest 'find' => sub { ), undef, 'Additional where clause in find call' ); # check find with a composite FK - my $rule = $builder->build({ source => 'Issuingrule' }); - my @pk = ( $rule->{branchcode}, $rule->{categorycode}, $rule->{itemtype} ); - is( ref(Koha::IssuingRules->find(@pk)), "Koha::IssuingRule", + my $letter = $builder->build({ source => 'Letter' }); + my @pk = ( + $letter->{module}, $letter->{code}, $letter->{branchcode}, + $letter->{message_transport_type}, $letter->{lang} + ); + is( ref(Koha::Notice::Templates->find(@pk)), "Koha::Notice::Template", 'Find returned a Koha object for composite primary key' ); is( Koha::Patrons->find(), undef, 'Find returns undef if no params passed' ); -- 2.7.4