PHPunit Xampp Update

This morning, I realized that the version of PHPUnit shipped with Xampp is out of date ..., Version 3.7.21. installed in Xampp, but the actual version (as of this writing) is 6.0.13.

I tried some solution suggested by Google (all old 5 years + solution), including

In any case, the pear does not seem to be a viable solution. Is there an easy way to upgrade PHPUnit in Xampp?

+6
source share
2 answers

In fact, it can be updated in three simple steps:

  1. Download the latest version of PHPUnit here: https://phpunit.de/index.html
  2. Copy phpunit.phar to C: \ xampp \ php.
  3. In the file: 'phpunit.bat', update the following line: "%PHPBIN%" "C:\xampp\php\phpunit" %* to: "%PHPBIN%" "C:\xampp\php\phpunit.phar" % *

You do not need to restart Apache.

Additional note : in your tests you need to replace: phpunit_framework_testcase with: TestCase

And include: use PHPUnit\Framework\TestCase at the top of the test files.

PHPunit in windows CMD

Of course, test suites are still compatible on my production server (centos7, follow the official documentation for updating on Linux https://phpunit.de/getting-started.html ).

PHPUnit in Linux CMD

+25
source

Thanks, it works fine with XAMPP v7.3.7

The latest phpunit.phar file can be downloaded at: https://phar.phpunit.de

  • The included version of XAMPP = PHPUnit 3.7.21 is from Sebastian Bergman.
  • DOWNLOAD Version (2019-08-11) = PHPUnit 8.3.4 from Sebastian Bergmann and authors.
+1
source

Source: https://habr.com/ru/post/1266267/


All Articles