|
Lines 1-6
Link Here
|
| 1 |
use Modern::Perl; |
1 |
use Modern::Perl; |
| 2 |
|
2 |
|
| 3 |
use Test::More tests => 36; |
3 |
use Test::More tests => 37; |
| 4 |
|
4 |
|
| 5 |
use Test::MockModule; |
5 |
use Test::MockModule; |
| 6 |
use t::lib::Mocks; |
6 |
use t::lib::Mocks; |
|
Lines 152-154
subtest 'Changes for format' => sub { # See also bug 18736
Link Here
|
| 152 |
qr/\d\.\d{2}$/, 'This price still seems to be formatted' ); |
152 |
qr/\d\.\d{2}$/, 'This price still seems to be formatted' ); |
| 153 |
# Note that the comparison with MAX_INT is already subject to rounding |
153 |
# Note that the comparison with MAX_INT is already subject to rounding |
| 154 |
}; |
154 |
}; |
| 155 |
- |
155 |
|
|
|
156 |
subtest 'Changes for default currency symbol position' => sub { |
| 157 |
plan tests => 2; |
| 158 |
|
| 159 |
t::lib::Mocks::mock_preference( 'CurrencyFormat', 'FR' ); |
| 160 |
$currency = Koha::Acquisition::Currency->new( |
| 161 |
{ |
| 162 |
currency => 'PLN', |
| 163 |
symbol => 'zł', |
| 164 |
rate => 1, |
| 165 |
active => 1, |
| 166 |
p_sep_by_space => 1, |
| 167 |
p_cs_precedes => 1, |
| 168 |
} |
| 169 |
); |
| 170 |
is( |
| 171 |
Koha::Number::Price->new('123456.78')->format( { with_symbol => 1 } ), |
| 172 |
'zł 123 456,78', |
| 173 |
'PLN: format 123 456,78 with symbol before' |
| 174 |
); |
| 175 |
$currency->p_cs_precedes(0); |
| 176 |
is( |
| 177 |
Koha::Number::Price->new('123456.78')->format( { with_symbol => 1 } ), |
| 178 |
'123 456,78 zł', |
| 179 |
'PLN: format 123 456,78 with symbol after' |
| 180 |
); |
| 181 |
}; |