Where do you put your unit test?

前端 未结 3 909
一个人的身影
一个人的身影 2020-12-10 01:11

I have found several conventions to housekeeping unit tests in a project and I\'m not sure which approach would be suitable for our next PHP project. I am trying to find the

3条回答
  •  青春惊慌失措
    2020-12-10 01:36

    The current best practice is to separate the unit tests into their own directory, #1. All of the "convention over configuration" systems do it like this, eg. Maven, Rails, etc.

    I think your alternatives are interesting and valid, and the tool support is certainly there to support them. But it's just not that popular (as far as I know). Some people object to having tests interspersed with production code. But it makes sense to me that if you always write unit tests, that they be located right with your code. It just seems simpler.

提交回复
热议问题