@@ -243,30 +243,20 @@ public function testCurrency() {
243
243
* @return void
244
244
*/
245
245
public function testCurrencyWithFractionAndPlaces () {
246
- $ result = $ this ->Number ->currency ('1.23 ' , 'GBP ' , array ( ' places ' => 3 ) );
247
- $ expected = '£1. 230 ' ;
246
+ $ result = $ this ->Number ->currency ('1.23 ' , 'EUR ' , [ ' locale ' => ' de_DE ' , ' places ' => 3 ] );
247
+ $ expected = '1, 230 € ' ;
248
248
$ this ->assertEquals ($ expected , $ result );
249
249
250
- $ result = $ this ->Number ->currency ('0.23 ' , 'GBP ' , array ( 'places ' => 3 ) );
250
+ $ result = $ this ->Number ->currency ('0.23 ' , 'GBP ' , [ 'places ' => 3 , ' fractionSymbol ' => ' p ' ] );
251
251
$ expected = '23p ' ;
252
252
$ this ->assertEquals ($ expected , $ result );
253
253
254
- $ result = $ this ->Number ->currency ('0.001 ' , 'GBP ' , array ( 'places ' => 3 ) );
254
+ $ result = $ this ->Number ->currency ('0.001 ' , 'GBP ' , [ 'places ' => 3 , ' fractionSymbol ' => ' p ' ] );
255
255
$ expected = '0p ' ;
256
256
$ this ->assertEquals ($ expected , $ result );
257
257
258
- $ this ->Number ->addFormat ('BHD ' , array ('before ' => 'BD ' , 'fractionSymbol ' => ' fils ' ,
259
- 'fractionExponent ' => 3 ));
260
- $ result = $ this ->Number ->currency ('1.234 ' , 'BHD ' , array ('places ' => 2 ));
261
- $ expected = 'BD 1.23 ' ;
262
- $ this ->assertEquals ($ expected , $ result );
263
-
264
- $ result = $ this ->Number ->currency ('0.234 ' , 'BHD ' , array ('places ' => 2 ));
265
- $ expected = '234 fils ' ;
266
- $ this ->assertEquals ($ expected , $ result );
267
-
268
- $ result = $ this ->Number ->currency ('0.001 ' , 'BHD ' , array ('places ' => 2 ));
269
- $ expected = '1 fils ' ;
258
+ $ result = $ this ->Number ->currency ('1.23 ' , 'EUR ' , ['locale ' => 'de_DE ' , 'precision ' => 1 ]);
259
+ $ expected = '1,2 € ' ;
270
260
$ this ->assertEquals ($ expected , $ result );
271
261
}
272
262
0 commit comments