Skip to content

add a note about @testdox to Data Provider section #246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/writing-tests-for-phpunit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down