Update PHPunit Xampp

后端 未结 3 1976
伪装坚强ぢ
伪装坚强ぢ 2021-02-03 13:38

This morning, I realized that the version of PHPUnit supplied with Xampp has been deprecated for quite a while... . The version 3.7.21. installed in Xampp, but the actual versio

3条回答
  •  花落未央
    2021-02-03 13:59

    Actually, it can be updated in three simple steps:

    1. Download the last version of PHPUnit here: https://phpunit.de/index.html
    2. Copy “phpunit.phar” in “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 don't need to restart apache.

    Additional note: In your tests, you will need to replace: phpunit_framework_testcase by: TestCase

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

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

提交回复
热议问题