Browse Source

One more try to fix tests on Travis

tags/2.0.13
SilverFire - Dmitry Naumenko 7 years ago
parent
commit
6424acf67f
No known key found for this signature in database
GPG Key ID: 39DD917A92B270A
  1. 14
      tests/framework/i18n/FormatterTest.php

14
tests/framework/i18n/FormatterTest.php

@ -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();
} }
} }
} }

Loading…
Cancel
Save