Skip to content
Permalink
Browse files

Fix tests that were failing becuase of ICU changes.

  • Loading branch information...
markstory committed Nov 14, 2018
1 parent b17e866 commit 853b691a52a6653d6b8c2c3589fe29c622cfa94b
Showing with 8 additions and 6 deletions.
  1. +8 −6 tests/TestCase/I18n/NumberTest.php
@@ -219,18 +219,20 @@ public function testCurrency()
$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';

0 comments on commit 853b691

Please sign in to comment.
You can’t perform that action at this time.