Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpunit (install) error

Tags:

phpunit

i have tried installing phpunit the install itself seems fine.

i can run "phpunit" but when i try to run a test "phpunit test.php" i get

'""C:\Program' is not recognized as an internal or external command,
operable program or batch file.
PHPUnit 3.3.17 by Sebastian Bergmann.

..

Time: 0 seconds

OK (2 tests, 2 assertions)

so as u can see, phpunit runs but with something wierd 1st. and in netbeans, i get "'""C:\Program' is not recognized as an internal or external command, operable program or batch file." and it stops

like image 582
iceangel89 Avatar asked Dec 04 '22 14:12

iceangel89


2 Answers

When you installed PHPUnit, it made a phpunit.bat file in your PHP installation directory. For example, mine was at C:\PHP\phpunit.bat.

Open up that file in Notepad. At the bottom you'll see a line that looks something like

set PHPBIN=".\php.exe"

Edit that to a correct absolute path, such as

set PHPBIN="C:\php.exe"

If the path has a space in it, you need to escape it with double quotes, such as

set PHPBIN="""C:\some long path\php.exe"""

Hope that helps.

like image 95
Nicholas Piasecki Avatar answered Dec 11 '22 08:12

Nicholas Piasecki


I had same problem and when run this command in:

phpunit -v

I saw following error :

'pupunit' is not recognized as an internal or external command, operable program or batch file.

I copy the phpunit.bat in system32 folder( C:\Windows\System32 ) and it work.

like image 23
za_al Avatar answered Dec 11 '22 10:12

za_al