Lines 19-28
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
use Test::More tests => 6; |
21 |
use Test::More tests => 6; |
|
|
22 |
use Koha::Database; |
22 |
use Koha::Acquisition::Currency; |
23 |
use Koha::Acquisition::Currency; |
23 |
use Koha::Acquisition::Currencies; |
24 |
use Koha::Acquisition::Currencies; |
24 |
use t::lib::TestBuilder; |
25 |
use t::lib::TestBuilder; |
25 |
|
26 |
|
|
|
27 |
my $schema = Koha::Database->schema; |
28 |
$schema->storage->txn_begin; |
29 |
my $dbh = C4::Context->dbh; |
30 |
|
31 |
# Start transaction |
32 |
$dbh->{RaiseError} = 1; |
33 |
|
26 |
my $builder = t::lib::TestBuilder->new; |
34 |
my $builder = t::lib::TestBuilder->new; |
27 |
my $nb_of_currencies = Koha::Acquisition::Currencies->search->count; |
35 |
my $nb_of_currencies = Koha::Acquisition::Currencies->search->count; |
28 |
my $new_currency_1 = Koha::Acquisition::Currency->new({ |
36 |
my $new_currency_1 = Koha::Acquisition::Currency->new({ |
Lines 56-58
is ( $nb_of_active_currencies, 1, 'Only 1 currency should be marked as active' )
Link Here
|
56 |
|
64 |
|
57 |
$retrieved_currency_1->delete; |
65 |
$retrieved_currency_1->delete; |
58 |
is( Koha::Acquisition::Currencies->search->count, $nb_of_currencies + 1, 'Delete should have deleted the currency' ); |
66 |
is( Koha::Acquisition::Currencies->search->count, $nb_of_currencies + 1, 'Delete should have deleted the currency' ); |
59 |
- |
67 |
|