Check that class exists

main
Lars Strojny 4 years ago
parent 404dea61c2
commit 5a02ea6a96
No known key found for this signature in database
GPG Key ID: 887416A2AD3B0CA9

@ -154,9 +154,11 @@ class PlatformRepository extends ArrayRepository
break; break;
case 'intl': case 'intl':
# Add a seperate version for the CLDR library version if (class_exists('ResourceBundle', false)) {
$cldrVersion = \ResourceBundle::create('root', 'ICUDATA-curr', false)->get('Version'); # Add a seperate version for the CLDR library version
$this->addLibrary('cldr', 'The unicode CLDR project', $cldrVersion); $cldrVersion = \ResourceBundle::create('root', 'ICUDATA-curr', false)->get('Version');
$this->addLibrary('cldr', 'The unicode CLDR project', $cldrVersion);
}
$name = 'icu'; $name = 'icu';
$description = 'The ICU unicode and globalization support library'; $description = 'The ICU unicode and globalization support library';

@ -69,12 +69,15 @@ class PlatformRepositoryTest extends TestCase {
$this->assertSame('4.0.1.0-dev', $package->getVersion()); $this->assertSame('4.0.1.0-dev', $package->getVersion());
} }
public function testICULibraryVersion() public function testICULibraryVersion() {
{
if (!defined('INTL_ICU_VERSION')) { if (!defined('INTL_ICU_VERSION')) {
$this->markTestSkipped('Test only work with ext-intl present'); $this->markTestSkipped('Test only work with ext-intl present');
} }
if (!class_exists('ResourceBundle', false)) {
$this->markTestSkipped('Test only work with ResourceBundle class present');
}
$platformRepository = new PlatformRepository(); $platformRepository = new PlatformRepository();
$packages = $platformRepository->getPackages(); $packages = $platformRepository->getPackages();

Loading…
Cancel
Save