From f8a8be05bb0de1ab4b7bc1a81832a82d2ac4ee8d Mon Sep 17 00:00:00 2001 From: Peter Lucht Date: Thu, 5 Aug 2021 23:36:47 +0200 Subject: [PATCH] add a note about @testdox to Data Provider section resolves sebastianbergmann/phpunit-documentation-english#218 --- src/writing-tests-for-phpunit.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/writing-tests-for-phpunit.rst b/src/writing-tests-for-phpunit.rst index 029abe414..5b2ed0334 100644 --- a/src/writing-tests-for-phpunit.rst +++ b/src/writing-tests-for-phpunit.rst @@ -368,6 +368,12 @@ Output will be more verbose as it'll contain that name of a dataset that breaks FAILURES! Tests: 4, Assertions: 4, Failures: 1. +.. admonition:: Note + + You can make the test output more verbose by defining a sentence and using the test's parameter names as placeholders + (``$a``, ``$b`` and ``$expected`` in the example above) with the :ref:`appendixes.annotations.testdox` annotation. + You can also refer to the name of a named data set with ``$_dataName``. + .. code-block:: php :caption: Using a data provider that returns an Iterator object :name: writing-tests-for-phpunit.data-providers.examples.DataTest2.php @@ -442,7 +448,7 @@ Output will be more verbose as it'll contain that name of a dataset that breaks if (is_array($row)) { $row = array_map('intval', $row); } - + $this->key = 0; }