Merge pull request #3219 from dokuwiki-translate/lang_update_111_1596591740
[dokuwiki.git] / _test / fetchphpunit.php
blob293bcf768eb7dd52cae699fd6455ff26dbfab5bf
1 #!/usr/bin/env 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);