I\'m a newbie programmer and I have tried for an embarrassingly long time to get PHPUnit set up and working with WAMP. I have read the documentation and went through various sit
For me this is the fastests and easiest way.
Make sure you have wamp with WAMP with PHP 7 installed as phpunit requires PHP7 to work! or at least 6.2
Go to folder wamp64\bin\php\php7.0.10 (wherever you installed your wamp - BEWARE last folder is name of PHP version you have so it might be different then above )
We will be working in this folder during entire installation. So if I say edit file etc it means in this folder.
At the time of writing this I get version phpunit 6.2 and php7.0.10 4. Copy downloaded file to wamp64\bin\php\php7.0.10 folder For me it's: phpunit-6.2.2.phar for you it might be different version.
Now change name of the phpunit-6.2.2.phar to phpunit.phar
Now make sure you have added your php to PATH in Environment Variables To do this on Windows 10 and Windows 8
6a. In Search, search for and then select: System (Control Panel)
6b. Click the Advanced system settings link.
6c. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
6d. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Paste location of your PHP. For me it would be: D:\AnyFolderYouInsalledWampTo\wamp64\bin\php\php7.0.10
(if in PATH there was other command or path just add ";" at the end. For exmaple:
%someOtherCommand%; D:\AnyFolderYouInsalledWampTo\wamp64\bin\php\php7.0.10)
6e. Click OK. Close all remaining windows by clicking OK.
In cmd (to run cmd go to search in Windows and type cmd.exe and click Enter)
go to folder wamp64\bin\php\php7.0.10
(to go to folder type for example cd D:\AnyFolderYouInsalledWampTo\wamp64\bin\php\php7.0.10
)
now once you are in this folder run this command in cmd: echo @php "%~dp0phpunit.phar" %* > phpunit.cmd
now run this command:
phpunit
you should get list of all commands available in phpunit
now run this:
phpunit --check-version
you will get info what phpunit version you have and if you are using the newest version.
if this doesn't work go to wamp64\bin\php\php7.0.10
Edit file phpunit.bat
Add this line:
""%PHPBIN%" "D:\AnyFolderYouInsalledWampTo\wamp64\bin\php\php7.0.10\phpunit.phar" %*
Repeat point 9.
if it still doesn't work let me know.