mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Makes the locale test not always pass, be verbose when it is skipped.
This commit is contained in:
parent
cd96ef9fc9
commit
6f74e1958b
1 changed files with 5 additions and 3 deletions
|
@ -587,12 +587,14 @@ class CakeNumberTest extends CakeTestCase {
|
|||
*/
|
||||
public function testReadableSizeLocalized() {
|
||||
$restore = setlocale(LC_NUMERIC, 0);
|
||||
setlocale(LC_NUMERIC, 'de_DE');
|
||||
|
||||
$this->skipIf(setlocale(LC_NUMERIC, 'de_DE') === false, "The German locale isn't available.");
|
||||
|
||||
$result = $this->Number->toReadableSize(1321205);
|
||||
$this->assertRegExp('/1[,.]26 MB/', $result);
|
||||
$this->assertEquals('1,26 MB', $result);
|
||||
|
||||
$result = $this->Number->toReadableSize(1024 * 1024 * 1024 * 512);
|
||||
$this->assertRegExp('/512[,.]00 GB/', $result);
|
||||
$this->assertEquals('512,00 GB', $result);
|
||||
setlocale(LC_NUMERIC, $restore);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue