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

(-)a/t/Number/Price.t (-8 / +14 lines)
Lines 49-61 is( Koha::Number::Price->new(3)->unformat, '3', 'US: unformat 3' ); Link Here
49
is( Koha::Number::Price->new(1234567890)->unformat,
49
is( Koha::Number::Price->new(1234567890)->unformat,
50
    '1234567890', 'US: unformat 1234567890' );
50
    '1234567890', 'US: unformat 1234567890' );
51
51
52
# Bug 18900 - Check params are not from system environement
52
SKIP: {
53
setlocale(LC_NUMERIC, "fr_FR.UTF-8");
53
    # Bug 18900 - Check params are not from system environement
54
is( Koha::Number::Price->new(12345678.9)->format( { %$format, with_symbol => 1 } ),
54
    setlocale(LC_NUMERIC, "fr_FR.UTF-8");
55
    '12,345,678.90', 'US: format 12,345,678.90 with symbol' );
55
    my $current_locale = setlocale(LC_NUMERIC);
56
is( Koha::Number::Price->new('12,345,678.90')->unformat,
56
57
    '12345678.9', 'US: unformat 12345678.9' );
57
    skip "fr_FR.UTF-8 locale required for tests and missing", 2
58
setlocale(LC_NUMERIC, $orig_locale);
58
        unless $current_locale eq 'fr_FR.UTF-8';
59
60
    is( Koha::Number::Price->new(12345678.9)->format( { %$format, with_symbol => 1 } ),
61
        '12,345,678.90', 'US: format 12,345,678.90 with symbol' );
62
    is( Koha::Number::Price->new('12,345,678.90')->unformat,
63
        '12345678.9', 'US: unformat 12345678.9' );
64
    setlocale(LC_NUMERIC, $orig_locale);
65
}
59
66
60
t::lib::Mocks::mock_preference( 'CurrencyFormat', 'FR' );
67
t::lib::Mocks::mock_preference( 'CurrencyFormat', 'FR' );
61
$currency = Koha::Acquisition::Currency->new({
68
$currency = Koha::Acquisition::Currency->new({
62
- 

Return to bug 18900