From da5ddb8386689b5146fe5dfbf5a3b0fbb3718ec1 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 11 Jan 2017 14:51:43 +0100 Subject: [PATCH] Bug 7728: QA fixes - Remove useless comments - Use Koha::Objects::find instead of Koha::Objects::search --- t/db_dependent/Serials/ReNewSubscription.t | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/t/db_dependent/Serials/ReNewSubscription.t b/t/db_dependent/Serials/ReNewSubscription.t index 21e06e0..43cc4e8 100644 --- a/t/db_dependent/Serials/ReNewSubscription.t +++ b/t/db_dependent/Serials/ReNewSubscription.t @@ -26,25 +26,15 @@ use Test::MockModule; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Context; -use Koha::Database; use C4::Serials; +use Koha::Database; +use Koha::Subscription::Histories; + my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; my $builder = t::lib::TestBuilder->new(); -#my $library = $builder->build({ -# source => 'Subscription', -#}); - -#my $mContext = new Test::MockModule('C4::Context'); -#$mContext->mock( 'userenv', sub { -# return { branch => $library->{branchcode} }; -#}); - - -#my $dbh = C4::Context->dbh; # after start transaction of testbuilder # create fake numberpattern & fake periodicity my $frequency = $builder->build({ @@ -95,7 +85,7 @@ my $subscriptionhistory = $builder->build({ # Renew the subscription and check that enddate has not been set ReNewSubscription($subscription->{subscriptionid},'',"2016-01-01",'','',12,''); -my @history = Koha::Subscription::Histories->search( {subscriptionid => $subscription->{subscriptionid} } ); +my @history = Koha::Subscription::Histories->find($subscription->{subscriptionid}); is ( $history[0]->histenddate(), undef, 'subscription history not empty after renewal'); -- 2.1.4