aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/test-compat.php
blob: c1bf40f794f7c580b4f5910a80633f6c6580c1cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

use Symfony\Component\Intl\Intl;

require_once __DIR__ . '/common.php';
require_once __DIR__ . '/autoload.php';

if (1 !== $GLOBALS['argc']) {
    bailout(<<<MESSAGE
Usage: php test-compat.php

Tests the compatibility of the current ICU version (bundled in ext/intl) with
different versions of symfony/icu.

For running this script, the intl extension must be loaded and all vendors
must have been installed through composer:

    composer install --dev

MESSAGE
    );
}

echo LINE;
echo centered("ICU Compatibility Test") . "\n";
echo LINE;

echo "Your ICU version: " . Intl::getIcuVersion() . "\n";

echo "Compatibility with symfony/icu:\n";

$branches = array(
    '1.1.x',
    '1.2.x',
);

cd(__DIR__ . '/../../vendor/symfony/icu/Symfony/Component/Icu');

foreach ($branches as $branch) {
    run('git checkout ' . $branch . ' 2>&1');

    exec('php ' . __DIR__ . '/util/test-compat-helper.php > /dev/null 2> /dev/null', $output, $status);

    echo "$branch: " . (0 === $status ? "YES" : "NO") . "\n";
}

echo "Done.\n";