PHPUnit @dataProvider simply doesn't work

前端 未结 8 1762
后悔当初
后悔当初 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:37

    That error means that at least one of the data arrays that your data-provider method is returning is empty. For example:

    public function dataProvider() {
        return array(
            array(1, 2, 3),
            array(),           // this will cause a "Missing argument 1" error
            array(4, 5, 6)
        );
    }
    

    Because you're generating the data arrays dynamically, you'll need to debug your data source(s) and figure out why that would be the case.

提交回复
热议问题