phpunit --debug still displays only dots

前端 未结 4 1303
忘掉有多难
忘掉有多难 2021-02-03 18:29

I want to see which test is currently executed during a phpunit run.

I use the --debug param but still only get dots:

$ phpunit --debug 
PHPUnit          


        
相关标签:
4条回答
  • 2021-02-03 19:06

    The best solution I find was to add logging section to your phpunit.xml file

    <logging>
        <log type="testdox-text" target="php://stdout"/>
    </logging>
    
    0 讨论(0)
  • 2021-02-03 19:20

    I had the same problem and resolved it by removing this:

    printerClass="PHPUnit_TextUI_ResultPrinter"
    

    from the options on the base tag in the phpunit.xml config file.

    0 讨论(0)
  • 2021-02-03 19:29

    You want to be using --testdox

    phpunit --testdox

    0 讨论(0)
  • 2021-02-03 19:29

    (Answering the question of "how to see which test is currently running")

    As you've noticed --debug and --verbose are of little help. (I use --verbose most of the time, but because it tells me more information when things go wrong, and isn't really very verbose the rest of the time.)

    Here was my first try:

    phpunit --verbose --tap
    

    I tried it out on a test suite that has some slow tests. It worked beautifully until test 21, then nothing, then a few minutes later tests 22 to 598 appeared in one go. I suspect output buffering. Here is a variation that does not have this problem, but requires two terminal windows open:

    phpunit --verbose --log-tap tap.log
    

    Then in another window:

    tail -f tap.log
    

    Actually it doesn't tell you exactly what you want, because it only reports which function it was working on. So, when you get a delay you have to wait for the test to finish to discover which is the slow test.

    To get more control consider writing your own test listener.

    0 讨论(0)
提交回复
热议问题