From 853b691a52a6653d6b8c2c3589fe29c622cfa94b Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 14 Nov 2018 09:54:08 -0500 Subject: [PATCH] Fix tests that were failing becuase of ICU changes. --- tests/TestCase/I18n/NumberTest.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/TestCase/I18n/NumberTest.php b/tests/TestCase/I18n/NumberTest.php index f022ab4ea32..127805d159e 100644 --- a/tests/TestCase/I18n/NumberTest.php +++ b/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';