From b3607bf2e5a6aaa43254cc211401be664fe3cd0f Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 4 Mar 2016 15:41:56 +0000 Subject: [PATCH] build: Ignore phpcs in /skins but not /includes/skins 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 | 8 ++++---- tests/phpunit/suites/ExtensionsTestSuite.php | 10 ++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index 38c7aaa96c..edce2ea267 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -26,9 +26,9 @@ 0 - node_modules - vendor - extensions - skins + node_modules/ + vendor/ + ^extensions/ + ^skins/ .git diff --git a/tests/phpunit/suites/ExtensionsTestSuite.php b/tests/phpunit/suites/ExtensionsTestSuite.php index 723328e2df..0e23fdde82 100644 --- a/tests/phpunit/suites/ExtensionsTestSuite.php +++ b/tests/phpunit/suites/ExtensionsTestSuite.php @@ -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' ) ); } } -- 2.20.1