PHPUnit print tests execution time

前端 未结 9 1416
天涯浪人
天涯浪人 2021-02-11 21:04

is there a way to print the execution time of each test with PHPUnit?

9条回答
  •  心在旅途
    2021-02-11 21:38

    I guess you could use the setUp and tearDown methods (which are called at the beginning and end of each test, respectively) to :

    • Log the current time before the test, in setUp,
    • And calculate the time the test took, in tearDown.


    Of course, you'll have to do this in each one of your test classes -- or in a super-class which will be inherited by all your test classes.

提交回复
热议问题