Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install PHPUnit with WAMP?

Tags:

php

phpunit

wamp

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 sites to see what I'm doing wrong, but I give up! I need someone to explain this to me like I'm mildly retarded.

I've probably seen all the guides on how to set it up, but feel free to link me to something you believe is foolproof!

like image 378
Elle Stewards Avatar asked Apr 30 '13 16:04

Elle Stewards


4 Answers

Try this blog : http://nishutayaltech.blogspot.com/2011/04/installing-phpunit-on-windows.html

This setup is for Windows. Hope this will help you.

like image 71
Nishu Tayal Avatar answered Nov 14 '22 07:11

Nishu Tayal


Also check this out, may be useful http://www.mark-leong.com/installing-php-and-phpunit-on-windows-7/

// adding required pear channels

pear channel-update pear.php.net

pear upgrade-all

pear channel-discover pear.phpunit.de

pear channel-discover components.ez.no

pear channel-discover pear.symfony-project.com

pear update-channels

// performing install

pear install --alldeps --force phpunit/PHPUnit

If everything ok, check whether phpunit have been installed by putting in command line

phpunit -v

If you encountered any errors or interrupted installing

pear clear-cache

may be usefull in that case.

like image 4
2 revs Avatar answered Nov 14 '22 07:11

2 revs


1) download https://phar.phpunit.de/phpunit.phar 2) run it via php phpunit.phar

Btw if that file ever goes away you can look at the original directions here: https://github.com/sebastianbergmann/phpunit

like image 2
adavea Avatar answered Nov 14 '22 07:11

adavea


I recommend using composer. It can be used per project, but also 'globally'.

Make a folder on your C drive called 'globalpackages', then cd into it from the command line.

run 'composer require phpunit/phpunit'

once that finishes run 'composer install'

once that finishes you can check the contents of C:\globalpackages\vendor\phpunit' and should see two phpunit files, one of them a bat.

Add C:\globalpackages\vendor\phpunit to your system path and then you will be able to run phpuni from anywhere on your system.

like image 2
S.. Avatar answered Nov 14 '22 07:11

S..