|
|
@ -327,10 +327,20 @@ class FormatterTest extends TestCase |
|
|
|
|
|
|
|
|
|
|
|
protected function ensureIntlUnitDataAvailable() |
|
|
|
protected function ensureIntlUnitDataAvailable() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
$skip = function () { |
|
|
|
|
|
|
|
$this->markTestSkipped('ICU data does not contain measure units information.'); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
new \ResourceBundle($this->formatter->locale, 'ICUDATA-unit'); |
|
|
|
$bundle = new \ResourceBundle($this->formatter->locale, 'ICUDATA-unit'); |
|
|
|
|
|
|
|
$massUnits = $bundle['units']['mass']; |
|
|
|
|
|
|
|
$lengthUnits = $bundle['units']['length']; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($massUnits === null || $lengthUnits === null) { |
|
|
|
|
|
|
|
$skip(); |
|
|
|
|
|
|
|
} |
|
|
|
} catch (\IntlException $e) { |
|
|
|
} catch (\IntlException $e) { |
|
|
|
$this->markTestSkipped('ICU data does not contain measure units information.'); |
|
|
|
$skip(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|