Run PHPUnit Tests in Certain Order

前端 未结 8 1414
悲哀的现实
悲哀的现实 2020-12-04 15:20

Is there a way to get the tests inside of a TestCase to run in a certain order? For example, I want to separate the life cycle of an object from creation to use

8条回答
  •  萌比男神i
    2020-12-04 15:51

    There really is a problem with your tests if they need to run in a certain order. Each test should be totally independent of the others: it helps you with defect localization, and allows you to get repeatable (and therefore debuggable) results.

    Checkout this site for a whole load of ideas / information, about how to factor your tests in a manner where you avoid these kinds of issues.

提交回复
热议问题