Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1249f01

Browse files
committed
[Intl] Added scripts to test the compatibility of various versions of symfony/icu with the ICU version installed on the system
1 parent 9dbafd7 commit 1249f01

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
use Symfony\Component\Intl\Intl;
4+
5+
require_once __DIR__ . '/common.php';
6+
require_once __DIR__ . '/autoload.php';
7+
8+
if (1 !== $GLOBALS['argc']) {
9+
bailout(<<<MESSAGE
10+
Usage: php test-compat.php
11+
12+
Tests the compatibility of the current ICU version (bundled in ext/intl) with
13+
different versions of symfony/icu.
14+
15+
For running this script, the intl extension must be loaded and all vendors
16+
must have been installed through composer:
17+
18+
composer install --dev
19+
20+
MESSAGE
21+
);
22+
}
23+
24+
echo LINE;
25+
echo centered("ICU Compatibility Test") . "\n";
26+
echo LINE;
27+
28+
echo "Your ICU version: " . Intl::getIcuVersion() . "\n";
29+
30+
echo "Compatibility with symfony/icu:\n";
31+
32+
$branches = array(
33+
'1.1.x',
34+
'1.2.x',
35+
);
36+
37+
cd(__DIR__ . '/../../vendor/symfony/icu/Symfony/Component/Icu');
38+
39+
foreach ($branches as $branch) {
40+
run('git checkout ' . $branch . ' 2>&1');
41+
42+
exec('php ' . __DIR__ . '/util/test-compat-helper.php > /dev/null 2> /dev/null', $output, $status);
43+
44+
echo "$branch: " . (0 === $status ? "YES" : "NO") . "\n";
45+
}
46+
47+
echo "Done.\n";
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
use Symfony\Component\Icu\IcuData;
4+
use Symfony\Component\Intl\ResourceBundle\Reader\BinaryBundleReader;
5+
6+
require_once __DIR__ . '/../common.php';
7+
require_once __DIR__ . '/../autoload.php';
8+
9+
$reader = new BinaryBundleReader();
10+
11+
$reader->read(IcuData::getResourceDirectory() . '/curr', 'en');
12+
$reader->read(IcuData::getResourceDirectory() . '/lang', 'en');
13+
$reader->read(IcuData::getResourceDirectory() . '/locales', 'en');
14+
$reader->read(IcuData::getResourceDirectory() . '/region', 'en');

0 commit comments

Comments
 (0)