Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade phpunit to new version?

Tags:

php

phpunit

Current, I installed phpunit. i use OS win 10. I think i installed new version from https://phpunit.de/ (current version 5.6, beta 5.7). But when check version with command line, it version 3.7. My version PHP Unit

i read these post: How do I update phpunit?. But i can't understand. Help me !!! :(

like image 226
Thanh Dong Avatar asked Nov 19 '16 03:11

Thanh Dong


People also ask

How do I know if PHPUnit is installed on Windows?

To verify PHPUnit has been installed type phpunit --version in command prompt. You should get something like PHPUnit x.y.z by Sebastian Bergmann and contributors.

Where is PHPUnit installed?

Global Installation Instead, PHPUnit should be managed as a project-local dependency. Either put the PHAR of the specific PHPUnit version you need in your project's tools directory (which should be managed by PHIVE) or depend on the specific PHPUnit version you need in your project's composer. json if you use Composer.


2 Answers

Just download the latest version and replace the old one. It is provided from the phpunit homepage.

$ wget https://phar.phpunit.de/phpunit.phar

$ chmod +x phpunit.phar

$ sudo mv phpunit.phar /usr/local/bin/phpunit

You are in the latest version. To check version you can use

$ phpunit --check-version
like image 81
Shiro Avatar answered Sep 17 '22 20:09

Shiro


You can download as per php version and install it as globally:

wget -O phpunit https://phar.phpunit.de/phpunit-7.phar

chmod +x phpunit

To check version you can use:

./phpunit --version

To set phpUnit as globally you can use:

sudo mv phpunit /usr/local/bin/phpunit

To run and test phpunit you can use:

phpunit

PHPUnit 7.3.1 by Sebastian Bergmann and contributors.

like image 42
Babulal N Choudhary Avatar answered Sep 17 '22 20:09

Babulal N Choudhary