PHPUnit - 'No tests executed' when using configuration file

后端 未结 22 953
故里飘歌
故里飘歌 2021-01-31 00:47

The Problem

To improve my quality of code, I\'ve decided to try to learn how to test my code using Unit Testing instead of my mediocre-at-best testing solutions.

22条回答
  •  甜味超标
    2021-01-31 01:42

    If you are using IDEs like JetBrains PHPStorm, please also notice that: in the Run/Debug Configurations window, the Test scope needs to be set to directory and point that directory to where your tests folder located.

    It just took me half an hour to figure out I forgot to set the directory. You can use global phpunit.phar as long as you set test scope and the directory correctly, the IDE will handle other stuff for you.

提交回复
热议问题