From ead6b1e53fb50c93d7f95953be80ddf951d89aae Mon Sep 17 00:00:00 2001 From: Reedy Date: Sun, 10 May 2020 00:32:25 +0100 Subject: [PATCH] Fix some PSR12.Properties.ConstantVisibility.NotFound in tests/phpunit/ Change-Id: I0f678049dc274f0cd29f543bb293c33da51d8529 --- tests/phpunit/MediaWikiIntegrationTestCase.php | 2 +- tests/phpunit/ResourceLoaderTestCase.php | 4 ++-- tests/phpunit/mocks/content/DummyContentForTesting.php | 2 +- tests/phpunit/mocks/session/DummySessionProvider.php | 2 +- tests/phpunit/suites/ParserTestTopLevelSuite.php | 6 +++--- tests/phpunit/unit/includes/BadFileLookupTest.php | 2 +- .../phpunit/unit/includes/language/LanguageFallbackTest.php | 2 +- tests/phpunit/unit/includes/libs/XmlTypeCheckTest.php | 6 +++--- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/phpunit/MediaWikiIntegrationTestCase.php b/tests/phpunit/MediaWikiIntegrationTestCase.php index 6ce01339722..ac0ebecece2 100644 --- a/tests/phpunit/MediaWikiIntegrationTestCase.php +++ b/tests/phpunit/MediaWikiIntegrationTestCase.php @@ -127,7 +127,7 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase { /** * Table name prefix. */ - const DB_PREFIX = 'unittest_'; + public const DB_PREFIX = 'unittest_'; /** * @var array diff --git a/tests/phpunit/ResourceLoaderTestCase.php b/tests/phpunit/ResourceLoaderTestCase.php index b2784e7d070..cfbabd69b79 100644 --- a/tests/phpunit/ResourceLoaderTestCase.php +++ b/tests/phpunit/ResourceLoaderTestCase.php @@ -7,10 +7,10 @@ abstract class ResourceLoaderTestCase extends MediaWikiTestCase { // Version hash for a blank file module. // Result of ResourceLoader::makeHash(), ResourceLoaderTestModule // and ResourceLoaderFileModule::getDefinitionSummary(). - const BLANK_VERSION = '9p30q'; + public const BLANK_VERSION = '9p30q'; // Result of ResoureLoader::makeVersionQuery() for a blank file module. // In other words, result of ResourceLoader::makeHash( BLANK_VERSION ); - const BLANK_COMBI = 'rbml8'; + public const BLANK_COMBI = 'rbml8'; /** * @param array|string $options Language code or options array diff --git a/tests/phpunit/mocks/content/DummyContentForTesting.php b/tests/phpunit/mocks/content/DummyContentForTesting.php index e3cac83c82c..27e68726e90 100644 --- a/tests/phpunit/mocks/content/DummyContentForTesting.php +++ b/tests/phpunit/mocks/content/DummyContentForTesting.php @@ -2,7 +2,7 @@ class DummyContentForTesting extends AbstractContent { - const MODEL_ID = "testing"; + public const MODEL_ID = "testing"; public function __construct( $data ) { parent::__construct( self::MODEL_ID ); diff --git a/tests/phpunit/mocks/session/DummySessionProvider.php b/tests/phpunit/mocks/session/DummySessionProvider.php index 31af4e550d8..1d6047accb9 100644 --- a/tests/phpunit/mocks/session/DummySessionProvider.php +++ b/tests/phpunit/mocks/session/DummySessionProvider.php @@ -12,7 +12,7 @@ use MediaWiki\Session\UserInfo; */ class DummySessionProvider extends SessionProvider { - const ID = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'; + public const ID = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'; public function provideSessionInfo( WebRequest $request ) { return new SessionInfo( SessionInfo::MIN_PRIORITY, [ diff --git a/tests/phpunit/suites/ParserTestTopLevelSuite.php b/tests/phpunit/suites/ParserTestTopLevelSuite.php index e00b81a46b0..e46610bf669 100644 --- a/tests/phpunit/suites/ParserTestTopLevelSuite.php +++ b/tests/phpunit/suites/ParserTestTopLevelSuite.php @@ -32,11 +32,11 @@ class ParserTestTopLevelSuite extends TestSuite { */ /** Include files shipped with MediaWiki core */ - const CORE_ONLY = 1; + public const CORE_ONLY = 1; /** Include non core files as set in $wgParserTestFiles */ - const NO_CORE = 2; + public const NO_CORE = 2; /** Include anything set via $wgParserTestFiles */ - const WITH_ALL = self::CORE_ONLY | self::NO_CORE; + public const WITH_ALL = self::CORE_ONLY | self::NO_CORE; /** @} */ diff --git a/tests/phpunit/unit/includes/BadFileLookupTest.php b/tests/phpunit/unit/includes/BadFileLookupTest.php index 4f9ee164a49..67015fc3a12 100644 --- a/tests/phpunit/unit/includes/BadFileLookupTest.php +++ b/tests/phpunit/unit/includes/BadFileLookupTest.php @@ -7,7 +7,7 @@ use MediaWiki\BadFileLookup; */ class BadFileLookupTest extends MediaWikiUnitTestCase { /** Shared with GlobalWithDBTest */ - const BLACKLIST = << [], 'fr' => [], 'sco' => [ 'en' ], diff --git a/tests/phpunit/unit/includes/libs/XmlTypeCheckTest.php b/tests/phpunit/unit/includes/libs/XmlTypeCheckTest.php index 8616b419229..6e1ba4b3784 100644 --- a/tests/phpunit/unit/includes/libs/XmlTypeCheckTest.php +++ b/tests/phpunit/unit/includes/libs/XmlTypeCheckTest.php @@ -9,10 +9,10 @@ class XmlTypeCheckTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; - const WELL_FORMED_XML = ""; - const MAL_FORMED_XML = ""; + private const WELL_FORMED_XML = ""; + private const MAL_FORMED_XML = ""; // phpcs:ignore Generic.Files.LineLength - const XML_WITH_PIH = ''; + private const XML_WITH_PIH = ''; /** * @covers XMLTypeCheck::newFromString