@@ -389,9 +389,14 @@ Data Provider
389389| no | yes | yes |
390390+-------------+--------------+------------+
391391
392- The ``DataProvider(string $methodName) `` attribute can be used on a test method
393- to specify a static method that is declared in the same class as the test method
394- as a :ref: `data provider <writing-tests-for-phpunit.data-providers >`.
392+ The ``DataProvider(string $methodName, bool $validateArgumentCount = true, bool $skipWhenEmpty = false) ``
393+ attribute can be used on a test method to specify a static method that is declared in the same
394+ class as the test method as a :ref: `data provider <writing-tests-for-phpunit.data-providers >`.
395+
396+ By default, PHPUnit reports an error when a data provider returns no data sets. Setting
397+ ``skipWhenEmpty `` to ``true `` causes the test to be marked as skipped instead. This is useful
398+ when a data provider legitimately produces no data sets in certain environments, for example
399+ when the data depends on optional fixtures or platform-specific conditions.
395400
396401
397402.. _appendixes.attributes.DataProviderExternal :
@@ -405,9 +410,12 @@ as a :ref:`data provider <writing-tests-for-phpunit.data-providers>`.
405410| no | yes | yes |
406411+-------------+--------------+------------+
407412
408- The ``DataProviderExternal(string $className, string $methodName) `` attribute can be used
409- on a test method to specify a static method that is declared in another class as a
410- :ref: `data provider <writing-tests-for-phpunit.data-providers >`.
413+ The ``DataProviderExternal(string $className, string $methodName, bool $validateArgumentCount = true, bool $skipWhenEmpty = false) ``
414+ attribute can be used on a test method to specify a static method that is declared in another
415+ class as a :ref: `data provider <writing-tests-for-phpunit.data-providers >`.
416+
417+ As with ``DataProvider ``, setting ``skipWhenEmpty `` to ``true `` causes the test to be marked
418+ as skipped when the data provider returns no data sets instead of reporting an error.
411419
412420
413421.. _appendixes.attributes.DataProviderClosure :
0 commit comments