Merge pull request #3100 from dokuwiki-translate/lang_update_62_1590712721
[dokuwiki.git] / _test / fetchphpunit.php
blobceea6652d72ab528233e3fd96d123758b27e5621
1 #!/usr/bin/php
2 <?php
3 /**
4 * Simple command line script to fetch the correct PHPUnit release
5 */
7 $phpVersion = PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION;
8 print "Running PHP $phpVersion\n";
10 switch ($phpVersion) {
11 case '5.6':
12 $phpunit = 'phpunit-5.phar';
13 break;
14 case '7.0':
15 $phpunit = 'phpunit-6.phar';
16 break;
17 case '7.1':
18 case '7.2':
19 case '7.3':
20 $phpunit = 'phpunit-7.phar';
21 break;
22 case '7.4':
23 $phpunit = 'phpunit-7.phar';
24 // PHP 5 backward compatibility lock to PHPUnit 7 (type hinting)
25 break;
26 default:
27 $phpunit = 'phpunit-7.phar';
31 $url = "https://phar.phpunit.de/$phpunit";
32 $out = __DIR__ . '/phpunit.phar';
34 $return = 0;
35 system("wget '$url' -O '$out'", $return);
36 if ($return !== 0) exit($return);
38 chmod($out, 0755);
39 print "Downloaded $phpunit\n";
40 exit(0);