mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Allow specifying a version requirement for the relevant CLDR
This commit is contained in:
parent
5fceb4799a
commit
404dea61c2
2 changed files with 57 additions and 10 deletions
|
@ -12,6 +12,7 @@
|
|||
|
||||
namespace Composer\Test\Repository;
|
||||
|
||||
use Composer\Package\Package;
|
||||
use Composer\Repository\PlatformRepository;
|
||||
use Composer\Test\TestCase;
|
||||
use Composer\Util\Platform;
|
||||
|
@ -67,4 +68,35 @@ class PlatformRepositoryTest extends TestCase {
|
|||
$this->assertNotNull($package, 'failed to find HHVM package');
|
||||
$this->assertSame('4.0.1.0-dev', $package->getVersion());
|
||||
}
|
||||
|
||||
public function testICULibraryVersion()
|
||||
{
|
||||
if (!defined('INTL_ICU_VERSION')) {
|
||||
$this->markTestSkipped('Test only work with ext-intl present');
|
||||
}
|
||||
|
||||
$platformRepository = new PlatformRepository();
|
||||
$packages = $platformRepository->getPackages();
|
||||
|
||||
/** @var Package $icuPackage */
|
||||
$icuPackage = null;
|
||||
/** @var Package $cldrPackage */
|
||||
$cldrPackage = null;
|
||||
|
||||
foreach ($packages as $package) {
|
||||
if ($package->getName() === 'lib-icu') {
|
||||
$icuPackage = $package;
|
||||
}
|
||||
|
||||
if ($package->getName() === 'lib-cldr') {
|
||||
$cldrPackage = $package;
|
||||
}
|
||||
}
|
||||
|
||||
self::assertNotNull($icuPackage, 'Expected to find lib-icu in packages');
|
||||
self::assertNotNull($cldrPackage, 'Expected to find lib-cldr in packages');
|
||||
|
||||
self::assertSame(3, substr_count($icuPackage->getVersion(), '.'), 'Expected to find real ICU version');
|
||||
self::assertSame(3, substr_count($cldrPackage->getVersion(), '.'), 'Expected to find real CLDR version');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue