diff --git a/Documentation/source/extending.rst b/Documentation/source/extending.rst index cf899ba..63a8877 100644 --- a/Documentation/source/extending.rst +++ b/Documentation/source/extending.rst @@ -55,6 +55,44 @@ a folder named like the sniff. E.g. you want to add a test for sniff :file:`src/Standards/Typo3Update/Sniffs/LegacyClassnames/DocCommentSniff.php`, the following folder has to exist: :file:`tests/Fixtures/Standards/Typo3Update/Sniffs/LegacyClassnames/DocCommentSniff/`. +Also for convenience add a test class with following content: + +.. code-block:: php + + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + + use Typo3Update\Tests\SniffsTest; + + class TypoScriptSniffTest extends SniffsTest + { + } + +Place it accordingly to namespace. Adjust namespace and class name. No code is needed, everything is +done in ``SniffsTest``. But this enables you to add ``--filter`` to ``phpunit`` to run just one +test. Also IDEs support to run the single test file. This makes development much faster and failing +tests more helpfull as they contain the class name. + .. _extending-tests-single: Single test per sniff