diff --git a/tests/php/Forms/DatetimeFieldTest.php b/tests/php/Forms/DatetimeFieldTest.php index 3f28a251557..95f6ce77f7b 100644 --- a/tests/php/Forms/DatetimeFieldTest.php +++ b/tests/php/Forms/DatetimeFieldTest.php @@ -148,7 +148,7 @@ public function testSetValueWithLocalised() // Some localisation packages exclude the ',' in default medium format $this->assertMatchesRegularExpression( - '#29/03/2003(,)? 11:00:00 (PM|pm)#', + '#29/03/2003(,)?\h11:00:00\h(PM|pm)#u', $datetimeField->Value(), 'User value is formatted, and in user timezone' ); diff --git a/tests/php/ORM/DBDatetimeTest.php b/tests/php/ORM/DBDatetimeTest.php index 71b24be225b..639cdb4f07b 100644 --- a/tests/php/ORM/DBDatetimeTest.php +++ b/tests/php/ORM/DBDatetimeTest.php @@ -127,10 +127,10 @@ public function testNice() // note: Some localisation packages exclude the ',' in default medium format i18n::set_locale('en_NZ'); - $this->assertMatchesRegularExpression('#11/12/2001(,)? 10:10 PM#i', $date->Nice()); + $this->assertMatchesRegularExpression('#11/12/2001(,)?\h10:10\hPM#iu', $date->Nice()); i18n::set_locale('en_US'); - $this->assertMatchesRegularExpression('#Dec 11(,)? 2001(,)? 10:10 PM#i', $date->Nice()); + $this->assertMatchesRegularExpression('#Dec\h11(,)?\h2001(,)?\h10:10\hPM#iu', $date->Nice()); } public function testDate() @@ -142,7 +142,7 @@ public function testDate() public function testTime() { $date = DBDatetime::create_field('Datetime', '2001-12-31 22:10:59'); - $this->assertMatchesRegularExpression('#10:10:59 PM#i', $date->Time()); + $this->assertMatchesRegularExpression('#10:10:59\hPM#iu', $date->Time()); } public function testTime24() diff --git a/tests/php/ORM/DBTimeTest.php b/tests/php/ORM/DBTimeTest.php index fa2420c5f8f..3bab67ba796 100644 --- a/tests/php/ORM/DBTimeTest.php +++ b/tests/php/ORM/DBTimeTest.php @@ -48,12 +48,12 @@ public function testParse($input, $expected) public function testNice() { $time = DBTime::create_field('Time', '17:15:55'); - $this->assertMatchesRegularExpression('#5:15:55 PM#i', $time->Nice()); + $this->assertMatchesRegularExpression('#5:15:55\hPM#iu', $time->Nice()); } public function testShort() { $time = DBTime::create_field('Time', '17:15:55'); - $this->assertMatchesRegularExpression('#5:15 PM#i', $time->Short()); + $this->assertMatchesRegularExpression('#5:15\hPM#iu', $time->Short()); } }