build: Ignore phpcs in /skins but not /includes/skins
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 4 Mar 2016 15:41:56 +0000 (15:41 +0000)
committerTimo Tijhof <krinklemail@gmail.com>
Fri, 4 Mar 2016 15:50:03 +0000 (15:50 +0000)
Since the match can be case-insensitive (apparently), this meant
ExtensionsTestSuite.php ("extensions") wasn't being validated either.

Bug: T127238
Change-Id: I679de924ebeb45150004783ce404fac92af026a7

phpcs.xml
tests/phpunit/suites/ExtensionsTestSuite.php

index 38c7aaa..edce2ea 100644 (file)
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -26,9 +26,9 @@
        <rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed">
                <severity>0</severity>
        </rule>
-       <exclude-pattern>node_modules</exclude-pattern>
-       <exclude-pattern>vendor</exclude-pattern>
-       <exclude-pattern>extensions</exclude-pattern>
-       <exclude-pattern>skins</exclude-pattern>
+       <exclude-pattern>node_modules/</exclude-pattern>
+       <exclude-pattern>vendor/</exclude-pattern>
+       <exclude-pattern type="relative">^extensions/</exclude-pattern>
+       <exclude-pattern type="relative">^skins/</exclude-pattern>
        <exclude-pattern>.git</exclude-pattern>
 </ruleset>
index 723328e..0e23fdd 100644 (file)
@@ -8,16 +8,14 @@
 class ExtensionsTestSuite extends PHPUnit_Framework_TestSuite {
        public function __construct() {
                parent::__construct();
-               $paths = array();
+               $paths = [];
                // Extensions can return a list of files or directories
-               Hooks::run( 'UnitTestsList', array( &$paths ) );
+               Hooks::run( 'UnitTestsList', [ &$paths ] );
                foreach ( $paths as $path ) {
                        if ( is_dir( $path ) ) {
                                // If the path is a directory, search for test cases.
                                // @since 1.24
-                               $suffixes = array(
-                                       'Test.php',
-                               );
+                               $suffixes = [ 'Test.php' ];
                                $fileIterator = new File_Iterator_Facade();
                                $matchingFiles = $fileIterator->getFilesAsArray( $path, $suffixes );
                                $this->addTestFiles( $matchingFiles );
@@ -26,7 +24,7 @@ class ExtensionsTestSuite extends PHPUnit_Framework_TestSuite {
                                $this->addTestFile( $path );
                        }
                }
-               if ( !count( $paths ) ) {
+               if ( !$paths ) {
                        $this->addTest( new DummyExtensionsTest( 'testNothing' ) );
                }
        }