Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT Ignore narrow no-break space in regex in tests #11291

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/php/Forms/DatetimeFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
Expand Down
6 changes: 3 additions & 3 deletions tests/php/ORM/DBDatetimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions tests/php/ORM/DBTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Loading