Merge branch 'feature/seperate-tests' into feature/45-removed-signals

This commit is contained in:
Daniel Siepmann 2017-05-04 08:45:10 +02:00
commit 470910b07a
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
3 changed files with 67 additions and 1 deletions

View file

@ -258,7 +258,7 @@ Using ``runtime-set``:
.. _configuration-removedTypoScriptConstantConfigFiles:
removedTypoScriptConstantsConfigFiles
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Configure where to look for configuration files defining the removed TypoScript constants.
Default is ``Configuration/Removed/TypoScriptConstants/*.yaml`` inside the standard itself.

View file

@ -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
<?php
namespace Typo3Update\Tests\Sniffs\Removed;
/*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
*
* 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

View file

@ -0,0 +1,28 @@
<?php
namespace Typo3Update\Tests\Sniffs\Removed;
/*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
*
* 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 TypoScriptConstantSniffTest extends SniffsTest
{
}