Update PHPunit Xampp

后端 未结 3 1972
伪装坚强ぢ
伪装坚强ぢ 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条回答
  •  -上瘾入骨i
    2021-02-03 14:03

    I had similar problem and found different solution. I have install phpunit with composer globaly

    composer global require phpunit/phpunit "^9"
    

    and localy in my project (both same version "^9").

    cd C:/fullpath/to/myproject
    
    composer require-dev phpunit/phpunit "^9"
    

    However for some reason phpunit was triggered from the xampp folder.. so what I did was removed

    phpunit
    phpunit.bat
    

    From C:\xampp\php and it worked for me.

    Just remember to set composer path to your env path in Windows.

    Now you can create phpunit.xml in you project root (here is what worked for me):

    
    
             
        
            
                tests
            
        
    
        
            
                src
            
        
    
    

    Then just cd to my root and run phpunit in my terminal to run all my tests from the tests folder

    Hope you will find this information helpfull *Editor: Hypper.js - using Git Bash on Windows 10 (incase you wonder)

提交回复
热议问题