From ba7a9149be1e29d2c2bef0f9eb656152cc7081c4 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 21 Nov 2014 11:09:48 +0100 Subject: [PATCH] Coding guidelines section about unit tests --- developer_manual/general/codingguidelines.rst | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/developer_manual/general/codingguidelines.rst b/developer_manual/general/codingguidelines.rst index 7b73d9a34..7cf90482d 100644 --- a/developer_manual/general/codingguidelines.rst +++ b/developer_manual/general/codingguidelines.rst @@ -165,6 +165,34 @@ Control Structures ?> +Unit tests +^^^^^^^^^^ +Unit tests must always extend the ``\Test\TestCase`` class, which takes care +of cleaning up the installation after the test. + +If a test is run with multiple different values, a data provider must be used. +The name of the data provider method must not start with ``test`` and must end +with ``Data``. + +.. code-block:: php + + assertEquals($expected, \Dummy::method($input)); + } + } JavaScript