Bugzilla – Attachment 72383 Details for
Bug 4078
Add the ability to customize and display the symbol for a currency
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 4078: Add a new test
Bug-4078-Add-a-new-test.patch (text/plain), 1.71 KB, created by
Kyle M Hall (khall)
on 2018-03-02 17:46:23 UTC
(
hide
)
Description:
Bug 4078: Add a new test
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-03-02 17:46:23 UTC
Size:
1.71 KB
patch
obsolete
>From 22022cea5cb54c5b148585ba2d8f15ad28a9edc3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 1 Feb 2018 14:35:06 -0300 >Subject: [PATCH] Bug 4078: Add a new test > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/Number/Price.t | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/t/Number/Price.t b/t/Number/Price.t >index 4b706b3..1676c8a 100644 >--- a/t/Number/Price.t >+++ b/t/Number/Price.t >@@ -1,6 +1,6 @@ > use Modern::Perl; > >-use Test::More tests => 31; >+use Test::More tests => 32; > > use Test::MockModule; > use t::lib::Mocks; >@@ -18,7 +18,6 @@ use_ok('Koha::Number::Price'); > my $orig_locale = setlocale(LC_NUMERIC); > my $format = { > p_cs_precedes => 1, # Force to place the symbol at the beginning >- p_sep_by_space => 0, # Force to not add a space between the symbol and the number > }; > t::lib::Mocks::mock_preference( 'CurrencyFormat', 'US' ); > $currency = Koha::Acquisition::Currency->new({ >@@ -26,6 +25,7 @@ $currency = Koha::Acquisition::Currency->new({ > symbol => '$', > rate => 1, > active => 1, >+ p_sep_by_space => 0, # Force to not add a space between the symbol and the number. This is the default behaviour > }); > > is( Koha::Number::Price->new->format( $format ), '0.00', 'US: format 0' ); >@@ -45,6 +45,10 @@ is( > '$1,234,567,890.00' > ); > >+$currency->p_sep_by_space(1); >+is( Koha::Number::Price->new(3)->format( { %$format, with_symbol => 1 } ), >+ '$ 3.00', 'US: format 3 with symbol and a space' ); >+ > is( Koha::Number::Price->new->unformat, '0', 'US: unformat 0' ); > is( Koha::Number::Price->new(3)->unformat, '3', 'US: unformat 3' ); > is( Koha::Number::Price->new(1234567890)->unformat, >-- >2.10.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 4078
:
7308
|
43320
|
45877
|
45878
|
45888
|
71118
|
71119
|
71120
|
71121
|
71122
|
71123
|
72378
|
72379
|
72380
|
72381
|
72382
|
72383
|
72511
|
72512
|
72513
|
72514
|
72515
|
72516
|
73196