View | Details | Raw Unified | Return to bug 7728
Collapse All | Expand All

(-)a/t/db_dependent/Serials/ReNewSubscription.t (-15 / +4 lines)
Lines 26-50 use Test::MockModule; Link Here
26
use t::lib::TestBuilder;
26
use t::lib::TestBuilder;
27
use t::lib::Mocks;
27
use t::lib::Mocks;
28
28
29
use C4::Context;
30
use Koha::Database;
31
use C4::Serials;
29
use C4::Serials;
32
30
31
use Koha::Database;
32
use Koha::Subscription::Histories;
33
33
my $schema = Koha::Database->new->schema;
34
my $schema = Koha::Database->new->schema;
34
$schema->storage->txn_begin;
35
$schema->storage->txn_begin;
35
36
36
my $builder = t::lib::TestBuilder->new();
37
my $builder = t::lib::TestBuilder->new();
37
#my $library = $builder->build({
38
#    source => 'Subscription',
39
#});
40
41
#my $mContext = new Test::MockModule('C4::Context');
42
#$mContext->mock( 'userenv', sub {
43
#    return { branch => $library->{branchcode} };
44
#});
45
46
47
#my $dbh = C4::Context->dbh; # after start transaction of testbuilder
48
38
49
# create fake numberpattern & fake periodicity
39
# create fake numberpattern & fake periodicity
50
my $frequency = $builder->build({
40
my $frequency = $builder->build({
Lines 95-101 my $subscriptionhistory = $builder->build({ Link Here
95
85
96
# Renew the subscription and check that enddate has not been set
86
# Renew the subscription and check that enddate has not been set
97
ReNewSubscription($subscription->{subscriptionid},'',"2016-01-01",'','',12,'');
87
ReNewSubscription($subscription->{subscriptionid},'',"2016-01-01",'','',12,'');
98
my @history = Koha::Subscription::Histories->search( {subscriptionid => $subscription->{subscriptionid} } );
88
my @history = Koha::Subscription::Histories->find($subscription->{subscriptionid});
99
89
100
is ( $history[0]->histenddate(), undef, 'subscription history not empty after renewal');
90
is ( $history[0]->histenddate(), undef, 'subscription history not empty after renewal');
101
91
102
- 

Return to bug 7728