PHPUnit @dataProvider simply doesn't work

前端 未结 8 1747
后悔当初
后悔当初 2021-02-01 16:04

I\'ve read the documentation on the topic, and my code follows all requirements of a data provider implementation. First of all, here\'s the full code of the test just in case i

8条回答
  •  鱼传尺愫
    2021-02-01 16:21

    To emphasise the point that micro_user made, the @dataProvider annotation must be in a docblock comment. i.e. do this:

    /**
     * @dataProvider myDataProvider
     *
     */
    public function testMyMethod(...)
    {
      ...
    }
    

    Don't do this since it won't work:

    /*
     * @dataProvider myDataProvider
     *
     */
    public function testMyMethod(...)
    {
      ...
    }
    

提交回复
热议问题