WordPress.org

Make WordPress Core

Ticket #53359: 53359-9-PHPCS-ruleset-update-the-config-for-WordPress.Files..patch

File 53359-9-PHPCS-ruleset-update-the-config-for-WordPress.Files..patch, 1.9 KB (added by jrf, 2 months ago)
  • phpcs.xml.dist

    From a2ce789d2ab953c36c27c014ddb000cf0107f435 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Tue, 20 Jul 2021 16:23:47 +0200
    Subject: [PATCH] PHPCS ruleset: update the config for WordPress.Files.FileName
    
    The WPCS sniff already takes the test classes in the `tests/phpunit/includes` directory into account.
    
    Only the test cases outside of that directory, i.e. in the `tests/phpunit/tests` directory need to be listed here.
    
    Includes alphabetizing the list.
    ---
     phpcs.xml.dist | 16 ++++------------
     1 file changed, 4 insertions(+), 12 deletions(-)
    
    diff --git a/phpcs.xml.dist b/phpcs.xml.dist
    index 3dce7d6cc2..3470b2e086 100644
    a b  
    234234        <rule ref="WordPress.Files.FileName">
    235235                <properties>
    236236                        <property name="custom_test_class_whitelist" type="array">
    237                                 <!-- Test case parent classes. -->
    238                                 <element value="WP_UnitTestCase"/>
    239                                 <element value="WP_Ajax_UnitTestCase"/>
    240                                 <element value="WP_Canonical_UnitTestCase"/>
    241                                 <element value="WP_Test_REST_TestCase"/>
    242                                 <element value="WP_Test_REST_Controller_Testcase"/>
    243                                 <element value="WP_Test_REST_Post_Type_Controller_Testcase"/>
    244                                 <element value="WP_XMLRPC_UnitTestCase"/>
     237                                <!-- Test case parent classes outside of the "includes" folder. -->
     238                                <element value="Tests_Query_Conditionals"/>
    245239                                <element value="WP_Filesystem_UnitTestCase"/>
    246                                 <element value="WP_Image_UnitTestCase"/>
    247240                                <element value="WP_HTTP_UnitTestCase"/>
    248                                 <element value="WP_Tests_Image_Resize_UnitTestCase"/>
     241                                <element value="WP_Image_UnitTestCase"/>
    249242                                <element value="WP_Import_UnitTestCase"/>
    250                                 <element value="Tests_Query_Conditionals"/>
    251                                 <element value="WP_Test_XML_TestCase"/>
    252243                                <element value="WP_Test_Adjacent_Image_Link_TestCase"/>
     244                                <element value="WP_Tests_Image_Resize_UnitTestCase"/>
    253245
    254246                                <!-- Mock classes. -->
    255247                                <element value="Spy_REST_Server"/>