38 lines
No EOL
792 B
PHP
Executable file
38 lines
No EOL
792 B
PHP
Executable file
#!/usr/bin/env php
|
|
<?php
|
|
/**
|
|
* @license MIT
|
|
* Copyright 2022 Dustin Wilson, et al.
|
|
* See LICENSE and AUTHORS files for details
|
|
*/
|
|
|
|
$dir = ini_get('extension_dir');
|
|
$php = escapeshellarg(\PHP_BINARY);
|
|
$code = escapeshellarg(__DIR__ . '/lib');
|
|
|
|
|
|
array_shift($argv);
|
|
foreach ($argv as $k => $v) {
|
|
if (in_array($v, ['--coverage', '--coverage-html'])) {
|
|
$argv[$k] = '--coverage-html tests/coverage';
|
|
}
|
|
}
|
|
|
|
$cmd = [
|
|
$php,
|
|
'-d opcache.enable_cli=0',
|
|
];
|
|
|
|
if (!extension_loaded('xdebug')) {
|
|
$cmd[] = '-d zend_extension=xdebug.so';
|
|
}
|
|
|
|
$cmd = implode(' ', [
|
|
...$cmd,
|
|
'-d xdebug.mode=coverage,develop,trace',
|
|
escapeshellarg(__DIR__ . '/vendor/bin/phpunit'),
|
|
'--configuration tests/phpunit.xml',
|
|
...$argv,
|
|
'--display-deprecations'
|
|
]);
|
|
passthru($cmd); |