|
|
@@ -219,18 +219,20 @@ class NumberTest extends TestCase
|
|
|
|
|
|
$options = ['locale' => 'fr_FR', 'pattern' => 'EUR #,###.00'];
|
|
|
$result = $this->Number->currency($value, 'EUR', $options);
|
|
|
- $expected = 'EUR 100 100 100,00';
|
|
|
- $this->assertEquals($expected, $result);
|
|
|
+ // The following tests use regexp because whitespace used
|
|
|
+ // is inconsistent between *nix & windows.
|
|
|
+ $expected = '/^EUR\W+100\W+100\W+100,00$/';
|
|
|
+ $this->assertRegExp($expected, $result);
|
|
|
|
|
|
$options = ['locale' => 'fr_FR', 'pattern' => '#,###.00 ¤¤'];
|
|
|
$result = $this->Number->currency($value, 'EUR', $options);
|
|
|
- $expected = '100 100 100,00 EUR';
|
|
|
- $this->assertEquals($expected, $result);
|
|
|
+ $expected = '/^100\W+100\W+100,00\W+EUR$/';
|
|
|
+ $this->assertRegExp($expected, $result);
|
|
|
|
|
|
$options = ['locale' => 'fr_FR', 'pattern' => '#,###.00;(¤#,###.00)'];
|
|
|
$result = $this->Number->currency(-1235.03, 'EUR', $options);
|
|
|
- $expected = '(€1 235,03)';
|
|
|
- $this->assertEquals($expected, $result);
|
|
|
+ $expected = '/^\(€1\W+235,03\)$/';
|
|
|
+ $this->assertRegExp($expected, $result);
|
|
|
|
|
|
$result = $this->Number->currency(0.5, 'USD', ['locale' => 'en_US', 'fractionSymbol' => 'c']);
|
|
|
$expected = '50c';
|