Created
May 4, 2018 15:35
-
-
Save danielsdeboer/3aaff419438830ab6d55830af2f26b87 to your computer and use it in GitHub Desktop.
Run PHPUnit, disabling Xdebug before execution, preserving arguments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
use Composer\XdebugHandler\XdebugHandler; | |
/* | |
* Check if Xdebug is enabled and disable it. | |
*/ | |
$xdebug = new XdebugHandler('no-prefix'); | |
$xdebug->check(); | |
unset($xdebug); | |
/* | |
* Unset the first argument, the name of the script. | |
*/ | |
unset($argv[0]); | |
$command = new PHPUnit_TextUI_Command(); | |
/* | |
* Run PHPUnit, passing all the arguments in. | |
*/ | |
$command->run(array_merge(['phpunit'], $argv)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment