Skip to content

Instantly share code, notes, and snippets.

@Daniel-Peder
Last active February 27, 2019 08:15
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Daniel-Peder/5d21d806f3d6e989bd10c1a406e31a3f to your computer and use it in GitHub Desktop.
Save Daniel-Peder/5d21d806f3d6e989bd10c1a406e31a3f to your computer and use it in GitHub Desktop.
netbeans 8.0.2 and PHPunit bug workaround
<?php
$phpunit_phar =__DIR__.'\\phpunit.phar'; // @edit path to Your phpunit
$php_exe_path='C:\Users\[username]\AppData\Local\PHP\v5.6\php.exe'; // @edit path to Your win php
array_splice($argv,-1,0,array("--")); // inject argument terminator
$argv[0] = $phpunit_phar; // inject phpuit path
array_unshift($argv,$php_exe_path); // inject php executable
//print_r($argv);
$cmd = '';
// build command line to execute
foreach($argv as $arg){
$cmd .= sprintf('"%s" ',$arg);
}
// echo $cmd."\n";
exec($cmd); // execute
@Daniel-Peder
Copy link
Author

Daniel-Peder commented Apr 25, 2016

SETUP:

  1. download this gist file phpunit4netbeans.php to the directory holding phpunit.phar
  2. edit paths in the script line 2-3 to reflect Your system setup
  3. update netbeans > tools > options > PHP > Frameworks & tools > PHPunit script to path to the phpunit4netbeans.php, example:

C:\Users\[your-path-to-phpunit-script]\phpunit4netbeans.php

All done, happy testing!

@Patricy
Copy link

Patricy commented May 19, 2016

thanks

@mharj
Copy link

mharj commented Jun 21, 2016

....
exec($cmd,$output); // execute
echo implode("\n",$output);

@miguelinares
Copy link

Thanks Daniel-Peder and mharj.
The phpUnit works with NetBeans 8.0.2

@Nick974
Copy link

Nick974 commented Nov 22, 2016

@wandbferreira
Copy link

wandbferreira commented Jan 5, 2019

OTHER SOLUTION:

  1. Download and Extract in your netbeans directory:
    netbeans-support-to-phpunit-6.5.zip
  • I copied this module from the netbeans 10.0, and it works for me!

@digitalhuman
Copy link

OTHER SOLUTION:

1. Download and Extract in your netbeans directory:
   [netbeans-support-to-phpunit-6.5.zip](https://mega.nz/#!ryYCRCCK)


* I copied this module from the netbeans 10.0, and it works for me!

@wandbferreira lets run it through Virustotal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment