diff --git a/Documentation/source/configuration.rst b/Documentation/source/configuration.rst index 72cae65..5cc0c0e 100644 --- a/Documentation/source/configuration.rst +++ b/Documentation/source/configuration.rst @@ -212,7 +212,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. 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 diff --git a/tests/Fixtures/Standards/Typo3Update/Sniffs/Classname.php b/tests/Fixtures/Standards/Typo3Update/Sniffs/Classname.php new file mode 100644 index 0000000..ca3784e --- /dev/null +++ b/tests/Fixtures/Standards/Typo3Update/Sniffs/Classname.php @@ -0,0 +1,28 @@ + + * + * 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 InlineCommentSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/InheritanceSniffTest.php b/tests/Sniffs/Classname/InheritanceSniffTest.php new file mode 100644 index 0000000..56c8bcb --- /dev/null +++ b/tests/Sniffs/Classname/InheritanceSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 InheritanceSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/InlineCommentSniffTest.php b/tests/Sniffs/Classname/InlineCommentSniffTest.php new file mode 100644 index 0000000..ca3784e --- /dev/null +++ b/tests/Sniffs/Classname/InlineCommentSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 InlineCommentSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/InstanceofSniffTest.php b/tests/Sniffs/Classname/InstanceofSniffTest.php new file mode 100644 index 0000000..49f9210 --- /dev/null +++ b/tests/Sniffs/Classname/InstanceofSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 InstanceofSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/InstantiationWithMakeInstanceSniffTest.php b/tests/Sniffs/Classname/InstantiationWithMakeInstanceSniffTest.php new file mode 100644 index 0000000..a54ab8f --- /dev/null +++ b/tests/Sniffs/Classname/InstantiationWithMakeInstanceSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 InstantiationWithMakeInstanceSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/InstantiationWithNewSniffTest.php b/tests/Sniffs/Classname/InstantiationWithNewSniffTest.php new file mode 100644 index 0000000..3c07834 --- /dev/null +++ b/tests/Sniffs/Classname/InstantiationWithNewSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 InstantiationWithNewSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/InstantiationWithObjectManagerSniffTest.php b/tests/Sniffs/Classname/InstantiationWithObjectManagerSniffTest.php new file mode 100644 index 0000000..c2348bf --- /dev/null +++ b/tests/Sniffs/Classname/InstantiationWithObjectManagerSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 InstantiationWithObjectManagerSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/IsACallSniffTest.php b/tests/Sniffs/Classname/IsACallSniffTest.php new file mode 100644 index 0000000..6930ddf --- /dev/null +++ b/tests/Sniffs/Classname/IsACallSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 IsACallSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/PhpDocCommentSniffTest.php b/tests/Sniffs/Classname/PhpDocCommentSniffTest.php new file mode 100644 index 0000000..fb7fa8c --- /dev/null +++ b/tests/Sniffs/Classname/PhpDocCommentSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 PhpDocCommentSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/StaticCallSniffTest.php b/tests/Sniffs/Classname/StaticCallSniffTest.php new file mode 100644 index 0000000..e3b5faa --- /dev/null +++ b/tests/Sniffs/Classname/StaticCallSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 StaticCallSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/TypeHintCatchExceptionSniffTest.php b/tests/Sniffs/Classname/TypeHintCatchExceptionSniffTest.php new file mode 100644 index 0000000..a7d14b9 --- /dev/null +++ b/tests/Sniffs/Classname/TypeHintCatchExceptionSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 TypeHintCatchExceptionSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/TypeHintSniffTest.php b/tests/Sniffs/Classname/TypeHintSniffTest.php new file mode 100644 index 0000000..e8c1637 --- /dev/null +++ b/tests/Sniffs/Classname/TypeHintSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 TypeHintSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/UseSniffTest.php b/tests/Sniffs/Classname/UseSniffTest.php new file mode 100644 index 0000000..ee03896 --- /dev/null +++ b/tests/Sniffs/Classname/UseSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 UseSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Deprecated/AjaxRegistrationTest.php b/tests/Sniffs/Deprecated/AjaxRegistrationTest.php new file mode 100644 index 0000000..b67c1ec --- /dev/null +++ b/tests/Sniffs/Deprecated/AjaxRegistrationTest.php @@ -0,0 +1,28 @@ + + * + * 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 AjaxRegistrationSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/LegacyClassname/MissingNamespaceSniffTest.php b/tests/Sniffs/LegacyClassname/MissingNamespaceSniffTest.php new file mode 100644 index 0000000..07239dc --- /dev/null +++ b/tests/Sniffs/LegacyClassname/MissingNamespaceSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 MissingNamespaceSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/LegacyClassname/MissingVendorForPluginsAndModulesSniffTest.php b/tests/Sniffs/LegacyClassname/MissingVendorForPluginsAndModulesSniffTest.php new file mode 100644 index 0000000..d73ca67 --- /dev/null +++ b/tests/Sniffs/LegacyClassname/MissingVendorForPluginsAndModulesSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 MissingVendorForPluginsAndModulesSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Removed/GenericConstantUsageSniffTest.php b/tests/Sniffs/Removed/GenericConstantUsageSniffTest.php new file mode 100644 index 0000000..c955042 --- /dev/null +++ b/tests/Sniffs/Removed/GenericConstantUsageSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 GenericConstantUsageSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Removed/GenericFunctionCallSniffTest.php b/tests/Sniffs/Removed/GenericFunctionCallSniffTest.php new file mode 100644 index 0000000..a0176b8 --- /dev/null +++ b/tests/Sniffs/Removed/GenericFunctionCallSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 GenericFunctionCallSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Removed/TypoScriptConstantSniffTest.php b/tests/Sniffs/Removed/TypoScriptConstantSniffTest.php new file mode 100644 index 0000000..cec7d71 --- /dev/null +++ b/tests/Sniffs/Removed/TypoScriptConstantSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 +{ +} diff --git a/tests/Sniffs/Removed/TypoScriptSniffTest.php b/tests/Sniffs/Removed/TypoScriptSniffTest.php new file mode 100644 index 0000000..f7f91cc --- /dev/null +++ b/tests/Sniffs/Removed/TypoScriptSniffTest.php @@ -0,0 +1,28 @@ + + * + * 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 +{ +} diff --git a/tests/SniffsTest.php b/tests/SniffsTest.php index 9f7a3b9..39f5ac4 100644 --- a/tests/SniffsTest.php +++ b/tests/SniffsTest.php @@ -29,7 +29,7 @@ use Symfony\Component\Finder\Finder; * * To add a test, just create the necessary fixture folder structure with files. */ -class SniffsTest extends TestCase +abstract class SniffsTest extends TestCase { /** * Get all fixtures for sniffs. @@ -61,16 +61,20 @@ class SniffsTest extends TestCase public function getSniffs() { $sniffs = []; - $finder = new Finder(); - $finder->in( - __DIR__ - . DIRECTORY_SEPARATOR . 'Fixtures' - . DIRECTORY_SEPARATOR . 'Standards' - . DIRECTORY_SEPARATOR . 'Typo3Update' - . DIRECTORY_SEPARATOR . 'Sniffs' - ); - foreach ($finder->directories()->name('*Sniff') as $folder) { + $classnameParts = array_slice(explode('\\', get_class($this)), 3); + $lastIndex = count($classnameParts) - 1; + $classnameParts[$lastIndex] = substr($classnameParts[$lastIndex], 0, -4); + $folderName = array_pop($classnameParts); + $folder = array_merge([ + __DIR__, + 'Fixtures', 'Standards', 'Typo3Update', 'Sniffs', + ], $classnameParts); + + $finder = new Finder(); + $finder->in(implode(DIRECTORY_SEPARATOR, $folder)); + + foreach ($finder->directories()->name($folderName) as $folder) { $sniff = [ $folder, [],