Install PHPUNIT with Composer

前端 未结 7 1453
面向向阳花
面向向阳花 2021-02-13 02:27

I have project on Symfony 2 and i would like use PHPUNIT on Windows 7.

On githut phpunit is:

Composer

Simply add a dependency on phpunit/phpunit to your proje         


        
7条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-13 03:06

    When you install PHP-Unit in windows via composer, the global installation will create files in

    C:\Users\YOUR_USERNAME\AppData\Roaming\Composer
    

    To execute phpunit easily via command line you need to add path of phpunit.bat file in windows Environment Variables. For this:

    1. Right click My Computer
    2. Go to Properties -> Advance system settings and
    3. Click Environment variables from the Advance tab.

    Now add C:\Users\YOUR_USERNAME\AppData\Roaming\Composer\vendor\bin to the windows PATH.

    You can now run the phpunit from command. Note that you may need to restart your command prompt for the changes to take effect.

提交回复
热议问题